home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 031a / wedl100.zip / WEDL.DOC < prev    next >
Text File  |  1991-10-14  |  140KB  |  3,921 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                 +----------------------------------------------+
  14.                 |                                              |
  15.                 |      W          W  EEEEE  DDDD    LL         |
  16.                 |      WW        WW  EE     DD  D   LL         |
  17.                 |       WW  WW  WW   EEEE   DD   D  LL         |
  18.                 |        WW WW WW    EE     DD  D   LL         |
  19.                 |         WW  WW     EEEEE  DDDD    LLLLLL     |
  20.                 |                                              |
  21.                 |                                              |
  22.                 |        Windows Enhanced Dialog Library       |
  23.                 |                                              |
  24.                 |                                              |
  25.                 |             Programmer's Manual              |
  26.                 |                                              |
  27.                 |                                              |
  28.                 |      Copyright (c) 1991, Mike Smedley        |
  29.                 |                                              |
  30.                 |             All Rights Reserved              |
  31.                 |                                              |
  32.                 |                                              |
  33.                 |               Version 1.00                   |
  34.                 |                                              |
  35.                 |             October 14, 1991                 |
  36.                 |                                              |
  37.                 +----------------------------------------------+
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.                                       1    
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.                                 SOFTWARE LICENSE
  67.  
  68.     This evaluation version of WEDL may be distributed, only in its
  69.     entirety, for others to evaluate.  None of the evaluation files may be
  70.     modified or deleted.  The evaluation version of the WEDL dynamic-link
  71.     library (file name WEDL-E.DLL) cannot be distributed with applications
  72.     built that use it.  This requires registration of the software.
  73.  
  74.     Software distribution companies that distribute user-supported software
  75.     may distribute this evaluation version of WEDL and charge a disk copying
  76.     fee not to exceed $10.00 in U.S. currency.
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.                                    DISCLAIMER
  84.  
  85.     The author of this software package, Mike Smedley, has used his best
  86.     efforts in producing this software and documentation.  These efforts
  87.     include the research, development, and testing of the software, and
  88.     production of the documentation.
  89.  
  90.     The author makes no warranty of any kind, expressed or implied, with
  91.     regards to the software or the documentation.  The author shall not be
  92.     liable in any event for incidental or consequential damages in
  93.     connection with, or arising out of, the furnishing, performance, or use
  94.     of this software package.
  95.  
  96.     All pricing subject to change without notice.
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.                                       2    
  113.  
  114.  
  115.                                TABLE OF CONTENTS
  116.  
  117.  
  118.     Acknowledgements.....................................................6
  119.     Introduction.........................................................7
  120.     Welcome to WEDL!.....................................................8
  121.     WEDL Features........................................................8
  122.     System Requirements..................................................10
  123.     Archive Contents.....................................................10
  124.     Registration Information.............................................11
  125.     WEDL Registration Form...............................................12
  126.     Contacting the Author................................................13
  127.     Version History......................................................13
  128.     Programming Guide....................................................14
  129.     Terminology..........................................................15
  130.     Naming Conventions...................................................15
  131.     How WEDL Fields Work.................................................15
  132.     Creating the Dialog Box..............................................16
  133.     Layout of the Dialog Procedure.......................................16
  134.     Defining the Form....................................................17
  135.     Defining Fields......................................................18
  136.     Defining Buttons.....................................................18
  137.     Defining Generic Controls............................................19
  138.     Defining Status Messages.............................................20
  139.     Writing Field Validation Functions...................................20
  140.     Writing Error Handlers...............................................21
  141.     Defining Context-Sensitive Help......................................21
  142.     Compiling and Linking................................................22
  143.     Executing the Program................................................22
  144.     Common Programming Errors............................................22
  145.     Function Reference...................................................25
  146.     button_define........................................................26
  147.     button_get_check.....................................................27
  148.     button_get_from_ctrl_id..............................................27
  149.     button_get_from_group................................................28
  150.     button_get_from_hwnd.................................................28
  151.     button_has_changed...................................................28
  152.     button_lock..........................................................29
  153.     button_set_check.....................................................29
  154.     button_unlock........................................................30
  155.     char_is_printable....................................................30
  156.     char_to_lower........................................................30
  157.     char_to_upper........................................................31
  158.     dproc_enter_error....................................................31
  159.     dproc_enter_idcancel.................................................31
  160.     dproc_enter_idok.....................................................31
  161.     dproc_enter_wm_command...............................................32
  162.     dproc_exit_error.....................................................32
  163.     field_data_to_log....................................................33
  164.     field_define.........................................................33
  165.     field_disable_feature................................................38
  166.  
  167.  
  168.                                       3    
  169.     field_enable_feature.................................................38
  170.     field_get_character..................................................39
  171.     field_get_decimal_pos................................................39
  172.     field_get_from_ctrl_id...............................................39
  173.     field_get_from_hwnd..................................................40
  174.     field_get_pos_info...................................................40
  175.     field_get_position...................................................41
  176.     field_get_text.......................................................41
  177.     field_has_changed....................................................41
  178.     field_insert_decimal.................................................42
  179.     field_lock...........................................................42
  180.     field_log_to_data....................................................43
  181.     field_log_to_phys....................................................43
  182.     field_phys_to_log....................................................44
  183.     field_set_text.......................................................44
  184.     field_unlock.........................................................44
  185.     form_begin...........................................................45
  186.     form_end.............................................................45
  187.     form_get_active......................................................45
  188.     form_get_from_hdlg...................................................46
  189.     form_has_changed.....................................................46
  190.     form_in_error_cond...................................................46
  191.     form_is_cancelled....................................................47
  192.     form_lock............................................................47
  193.     form_process.........................................................48
  194.     form_set_help........................................................48
  195.     form_terminate.......................................................49
  196.     form_unlock..........................................................49
  197.     form_validate........................................................49
  198.     genctrl_define.......................................................50
  199.     statmsg_define.......................................................50
  200.     str_delete_char......................................................51
  201.     str_insert_char......................................................52
  202.     str_is_blank.........................................................52
  203.     str_is_value_zero....................................................52
  204.     str_trim_spaces......................................................53
  205.     Data Type Reference..................................................54
  206.     BUTTON...............................................................55
  207.     FIELD................................................................56
  208.     FIELD_POS............................................................57
  209.     FORM.................................................................58
  210.     HBUTTON..............................................................61
  211.     HFIELD...............................................................61
  212.     HFORM................................................................61
  213.     HGENCTRL.............................................................61
  214.     LPBUTTON.............................................................61
  215.     LPFIELD..............................................................61
  216.     LPFIELD_POS..........................................................62
  217.     LPFORM...............................................................62
  218.     PBUTTON..............................................................62
  219.     PFIELD...............................................................62
  220.     PFIELD_POS...........................................................62
  221.     PFORM................................................................62
  222.  
  223.  
  224.                                       4    
  225.     PROC_ARRAY_INFO......................................................62
  226.     Appendix A:  Picture String Characters...............................64
  227.     Appendix B:  Field Editing Keys......................................66
  228.     Appendix C:  Glossary................................................68
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.                                       5    
  281.  
  282.  
  283.  
  284.     Acknowledgements
  285.  
  286.     BIX is a registered trademark of McGraw-Hill, Inc.
  287.     Borland is a registered trademark of Borland International.
  288.     CompuServe is a registered trademark of CompuServe, Inc.
  289.     IBM is a registered trademark of International Business Machines.
  290.     Microsoft is a registered trademark of the Microsoft Corporation.
  291.     MS-DOS is a registered trademark of the Microsoft Corporation.
  292.     Windows is a trademark of the Microsoft Corporation.
  293.  
  294.     This manual was written using Microsoft Word for Windows.
  295.     This manual was printed on a Hewlett-Packard LaserJet IIP.
  296.     The software was written using SemWare's QEdit text editor.
  297.     The resources for the demo program were created using Borland's Resource
  298.     Workshop.
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.                                       6    
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.                                 Introduction
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.                                       7    
  393.  
  394.  
  395.     Welcome to WEDL!
  396.  
  397.     Welcome to WEDL, the Windows Enhanced Dialog Library.  WEDL (pronounced
  398.     "weddle") is a collection of C functions for Microsoft Windows
  399.     programmers designed to make dialog box data entry much easier for both
  400.     the programmer and the user.
  401.  
  402.  
  403.     WEDL Features
  404.  
  405.     Enhanced Edit Fields
  406.  
  407.         Formatted Data Entry
  408.  
  409.             Picture strings are assigned to fields which describe the
  410.             allowable characters for each field position and specify the
  411.             position of formatting characters which aid the user in
  412.             correctly entering data.  For example, a telephone number field
  413.             could visually look like "(___)___-____" instead of just
  414.             "__________".  The user is not able to move the cursor to, or
  415.             edit, the embedded formatting characters.
  416.  
  417.         Field Validation
  418.  
  419.             Extensive field validation is provided via WEDL's own internal
  420.             validations and optionally through programmer-written validation
  421.             functions.  Validation is provided internally by picture strings
  422.             which describe the allowable characters for each field position,
  423.             and optional field validations such as Field Cannot Be Blank,
  424.             Field Cannot Be Zero, and Field Cannot Be Edited.  In addition,
  425.             you can write validation functions to perform any other needed
  426.             validations.  The user is not able to leave the field or select
  427.             "OK" until the field passes validation.
  428.  
  429.         Automatic Reading and Writing of Variables
  430.  
  431.             WEDL can automatically read and write your program's variables,
  432.             placing their contents into the fields for updating, then
  433.             storing the contents of the fields back to the variables upon
  434.             completion of the form.  Data type conversion is performed
  435.             on-the-fly.  This saves you from having to set and get the
  436.             contents of the fields and convert between data types.  The data
  437.             types supported by WEDL fields include character string, int,
  438.             unsigned, long, unsigned long, and double.
  439.  
  440.         Numeric Data Entry
  441.  
  442.             Numeric data entry is fully supported by WEDL.  There is a
  443.             standard numeric field which supports left-to-right digit input
  444.             and a decimal point. In addition, there is a calculator-style
  445.             numeric field which supports right-to-left digit input, a
  446.  
  447.  
  448.                                       8    
  449.             decimal point, and optional commas which appear only when a
  450.             digit precedes them (eg. the user would see "1,000.00" instead
  451.             of "1000.00").
  452.  
  453.         Overtype Mode
  454.  
  455.             WEDL fields provide an overtype mode in addition to the insert
  456.             mode Windows' edit fields provide.
  457.  
  458.         Case Conversion
  459.  
  460.             WEDL can automatically convert letters entered into a field to
  461.             uppercase or lowercase.  Also, there is a mixed-case option
  462.             which converts characters to uppercase or lowercase depending on
  463.             the previous character (eg. "Mixed Case").  Foreign alphabetic
  464.             characters are supported.
  465.  
  466.         Enhanced Editing Keys
  467.  
  468.             In addition to the editing keys available in Windows' edit
  469.             fields, WEDL provides a variety of new editing keys.  See
  470.             Appendix B for a list of editing keys.
  471.  
  472.     Enhanced Radio Buttons and Check Boxes
  473.  
  474.         Automatic Reading and Writing of Variables
  475.  
  476.             WEDL can automatically read and write your program's variables,
  477.             setting radio buttons and check boxes according to the
  478.             variables' values, then when the form is finished, the variables
  479.             are updated to specified values indicating whether the buttons
  480.             or check boxes are checked or not.  For a group of radio buttons
  481.             within a group box, a variable can automatically be set to a
  482.             value indicating which button in the group was checked.
  483.  
  484.     Enhanced Combo Boxes
  485.  
  486.         The edit fields in combo boxes have the same features as standard
  487.         edit fields, in addition to the ability to interact with the combo
  488.         box's list box.
  489.  
  490.     Context-Sensitive Help
  491.  
  492.         Context-sensitive help can easily be applied to individual fields,
  493.         radio buttons, check boxes, combo boxes, or any other control within
  494.         a dialog box.  When the user presses the F1 key, the Windows Help
  495.         application will be run and help information for the current control
  496.         will be displayed.
  497.  
  498.     Dynamic-Link Library
  499.  
  500.         WEDL's functions are contained in a Windows dynamic-link library.
  501.         The .DLL library format has many advantages over the normal .LIB
  502.  
  503.  
  504.                                       9    
  505.         format.  These include:
  506.  
  507.             The dynamic-link library will be loaded only once into memory,
  508.             no matter how many running applications use it.
  509.  
  510.             There is no need for multiple memory model versions of the
  511.             library.  No matter which memory model your program is written
  512.             in, it still uses the same dynamic-link library.
  513.  
  514.             The dynamic-link library is not compiler-specific.  Any C or C++
  515.             compiler that supports the creation of Windows applications will
  516.             be able to use WEDL.  Other language compilers that can produce
  517.             Windows applications may also be compatible with WEDL.
  518.  
  519.     Compatibility
  520.  
  521.         Since WEDL's functions are contained in a dynamic-link library, any
  522.         C or C++ compiler that supports the creation of Windows applications
  523.         will be able to use WEDL.
  524.  
  525.         WEDL does not replace Windows' dialog controls; it extends their
  526.         capabilities by subclassing them. Therefore WEDL is compatible with
  527.         all resource editors and CASE products that produce resource files.
  528.  
  529.         WEDL is compatible with foreign languages supported by Windows'
  530.         language driver.
  531.  
  532.  
  533.     System Requirements
  534.  
  535.     Microsoft Windows version 3.0 or greater (real, standard, or enhanced
  536.     mode). MS-DOS version 3.1 or greater.
  537.  
  538.     Microsoft Windows Software Development Kit or compatible tools.
  539.  
  540.     To use the WEDL library:
  541.         Any C or C++ compiler capable of producing Windows programs.  Other
  542.         language compilers may or may not be compatible.
  543.  
  544.     To rebuild the WEDL library:
  545.         Microsoft C 6.0 and Borland C++ 2.0 have been successfully tested.
  546.         Other C or C++ compilers may work as well.
  547.  
  548.  
  549.     Archive Contents
  550.  
  551.     The contents of the WEDL___.ZIP archive file are as follows:
  552.  
  553.     File Name       Description
  554.     ---------       -----------
  555.     DEMO.DEF        Demonstration program module definition file.
  556.     DEMO.EXE        Demonstration program executable file.
  557.     DEMO.H          Demonstration program header file.
  558.  
  559.  
  560.                                       10   
  561.     DEMO.ICO        Application icon for the demonstration program.
  562.     DEMO.MAK        Demonstration program make file.
  563.     DEMO.RC         Demonstration program resource source file.
  564.     DEMO?.C         Demonstration program source code files.
  565.     DEMOHELP.H      Header file containing demonstration program help
  566.                     definitions.
  567.     DEMOHELP.HLP    Demonstration program help file.
  568.     DEMOHELP.HPJ    Project file for the demonstration program's help file.
  569.     DEMOHELP.RTF    Source text for demonstration program's help file.
  570.     READ.ME         Contains last-minute updates and other important
  571.                     information.
  572.     REGISTER.DOC    Information about registering WEDL.
  573.     WEDL.DOC        WEDL documentation file.  (You are reading it now.)
  574.     WEDL-E.DLL      WEDL dynamic-link library.
  575.     WEDL.H          WEDL header file.
  576.     WEDL-E.LIB      WEDL import library.
  577.  
  578.  
  579.     Registration Information
  580.  
  581.     WEDL is a user-supported software product.  This means you are free to
  582.     try the software long enough to evaluate it and see if it meets your
  583.     needs. After a reasonable evaluation period, you are expected to either
  584.     register the software or cease using it.  Registering the software gives
  585.     you many benefits including:
  586.  
  587.         --  Unrestricted WEDL.DLL library.  The evaluation version
  588.             (WEDL-E.DLL) restricts the number of controls that can be
  589.             defined per form to 12, and it requires all evaluation files to
  590.             be present in the same directory as the program which uses WEDL.
  591.  
  592.         --  The full library source code.
  593.  
  594.         --  A high-quality printed manual.
  595.  
  596.         --  Royalty-free distribution of the WEDL.DLL library.  The
  597.             evaluation version, WEDL-E.DLL, cannot be distributed.
  598.  
  599.         --  Unlimited technical support via E-mail or postal mail.
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.                                       11   
  617.  
  618.  
  619.                               WEDL REGISTRATION FORM
  620.  
  621.  
  622.  
  623.     NAME:___________________________________________________________________
  624.  
  625.  
  626.     ADDRESS:________________________________________________________________
  627.  
  628.  
  629.     ________________________________________________________________________
  630.  
  631.  
  632.     CITY, STATE:____________________________________________________________
  633.  
  634.  
  635.     ZIP CODE: ____________________________  COUNTRY:________________________
  636.  
  637.  
  638.     TELEPHONE NUMBER:_________________  DISK SIZE:    5.25"     /     3.5"
  639.  
  640.  
  641.     WHERE DID YOU RECEIVE WEDL?_____________________________________________
  642.  
  643.  
  644.     WEDL Registration @ $55.00 per copy                          ___________
  645.  
  646.     Shipping and Handling
  647.     (U.S.A. and Canada = $5.00,  Overseas = $10.00) per copy     ___________
  648.  
  649.  
  650.     Florida Residents, Add 7% State Sales Tax ($4.20) per copy   ___________
  651.  
  652.  
  653.     Total Amount Enclosed:                                       ___________
  654.  
  655.  
  656.     Payment must be with a check or money order payable in
  657.     U.S. dollars and drawn on a U.S. bank.
  658.  
  659.     Make checks payable to Mike Smedley.
  660.  
  661.     Purchase orders are accepted from Fortune 500, government,
  662.     or educational institutions for orders of 3 copies or more.
  663.                                               ----------------
  664.  
  665.     To register WEDL, send the above information and payment to:
  666.  
  667.     Mike Smedley
  668.     P.O. Box 17325
  669.     Jacksonville, FL 32245-7325
  670.  
  671.  
  672.                                       12   
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.                                       13   
  729.  
  730.     Contacting the Author
  731.  
  732.     The author, Mike Smedley, can be contacted via one of the following
  733.     methods:
  734.  
  735.         Electronic Mail:
  736.             BIX:            m.smedley
  737.             CompuServe:     71331,2244
  738.  
  739.         Postal Mail:
  740.             Mike Smedley
  741.             P.O. Box 17325
  742.             Jacksonville, FL  32245-7325
  743.  
  744.     Electronic mail is the fastest and most reliable way to get technical
  745.     support.  If enough interest is expressed in WEDL, a bulletin board
  746.     system (BBS) may be established to provide even greater technical
  747.     support.
  748.  
  749.  
  750.     Version History
  751.  
  752.     Version         Date            Description
  753.     -------         ----            -----------
  754.     1.00            Oct. 14, 1991   Initial release.
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.                                       14   
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.                                Programming Guide
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.                                       15   
  841.  
  842.  
  843.     Terminology
  844.  
  845.     There are several terms that are used throughout this manual that are
  846.     important to understand.  Consult the Glossary in the back of this
  847.     manual for the definition of any terms you do not understand.
  848.  
  849.  
  850.     Naming Conventions
  851.  
  852.     Function Naming
  853.  
  854.         WEDL's functions are named in an object-oriented manner.  The first
  855.         part of the function name is the prefix which identifies the type of
  856.         object the function operates on.  The second part of the function
  857.         name identifies the action to perform on the object.  The following
  858.         is a list of prefixes used by WEDL functions:
  859.  
  860.         Prefix          Meaning
  861.         ------          -------
  862.         button_         Function operates on a button.
  863.         char_           Function operates on a character.
  864.         dproc_          Function operates on the dialog procedure.
  865.         field_          Function operates on a field.
  866.         form_           Function operates on a form.
  867.         genctrl_        Function operates on a generic control.
  868.         statmsg_        Function operates on a key status message.
  869.         str_            Function operates on a character string.
  870.  
  871.     Data Type and Variable Naming
  872.  
  873.         Data type and variable naming in WEDL is fairly consistent.  The
  874.         prefix 'h' is used for data types and variables corresponding to
  875.         handles.  The prefix 'p' is used for data types and variables
  876.         corresponding to pointers (not specifying near or far).  The prefix
  877.         'lp' is used for data types and variables corresponding to far
  878.         pointers.
  879.  
  880.  
  881.     How WEDL Fields Work
  882.  
  883.     WEDL fields may have embedded formatting characters in them in order to
  884.     assist the user in correctly inputting the required data.  For example,
  885.     the '(', ')', and '-' characters in a phone number field are considered
  886.     formatting characters.  Also there are special formatting characters
  887.     such as the commas and decimal point in numeric fields.  The user is not
  888.     able to move the cursor to, or edit, the formatting characters.
  889.     Formatting characters are not copied to the destination by default.
  890.  
  891.     Fields that contain embedded formatting characters are considered to be
  892.     in physical field format.  If you were to call the GetDlgItemText
  893.     function, you would get the field's physical contents.  Fields that do
  894.  
  895.  
  896.                                       16   
  897.     not contain embedded formatting characters are considered to be in
  898.     logical field format.
  899.  
  900.     When defining a field, the data type of the associated variable is
  901.     converted to a character string in physical field format and this string
  902.     is used to set the contents of the field.  When the user selects "OK",
  903.     the field's contents are converted back to the data types of their
  904.     variables and stored.
  905.  
  906.  
  907.     Creating the Dialog Box
  908.  
  909.     When creating a dialog box to be used with WEDL, very few special
  910.     considerations are needed.  You use your dialog box resource editor as
  911.     normal.  For edit controls to be defined as WEDL fields, you should
  912.     specify the WS_TABSTOP, WS_BORDER, WS_CHILD, ES_LEFT, and ES_AUTOHSCROLL
  913.     styles. For edit controls that belong to a combo box, use
  914.     CBS_AUTOHSCROLL instead of ES_AUTOHSCROLL.
  915.  
  916.     For radio buttons and check boxes, you should specify the
  917.     BS_AUTORADIOBUTTON or BS_AUTOCHECKBOX styles respectively.  If the check
  918.     box is a 3-state check box, use BS_AUTO3STATE.
  919.  
  920.     If you desire to have an automatically-updated Insert, CapsLock, or
  921.     NumLock key status message in your dialog box, place a static text
  922.     control for each message where you want the message to appear in the
  923.     dialog box.  The static text control must be wide enough to display the
  924.     entire status message.
  925.  
  926.     When assigning control IDs to the controls in the dialog box, avoid
  927.     using values 27700 - 27799.  These values are reserved by WEDL.
  928.  
  929.  
  930.     Layout of the Dialog Procedure
  931.  
  932.     The dialog procedure is where all definition and processing of the form
  933.     occur.  The layout of the dialog procedure is as follows:
  934.  
  935.     int FAR PASCAL DialogProc( HWND hDlg, unsigned message, WORD wParam,
  936.                                LONG lParam )
  937.     {
  938.         static HFORM hform = NULL;      /* must be static or global! */
  939.  
  940.         switch( message ) {
  941.  
  942.             case WM_INITDIALOG:
  943.                 /* Do not call any Windows functions that generate */
  944.                 /* WM_COMMAND messages before defining the form!   */
  945.                 hform = form_begin( hDlg );
  946.                 /* Call field_define() for each field to be defined. */
  947.                 /* Call button_define() for each button to be defined. */
  948.                 /* Call genctrl_define() for each generic control. */
  949.                 /* Call statmsg_define() for each status message. */
  950.  
  951.  
  952.                                       17   
  953.                 form_end( hform );
  954.                 /* Perform any other WM_INITDIALOG processing. */
  955.                 return( TRUE );
  956.  
  957.             case WM_COMMAND:
  958.                 dproc_enter_wm_command( hform, wParam, lParam );
  959.                 switch( wParam ) {
  960.  
  961.                     /* Add a case statement for each error value */
  962.                     /* given in your calls to field_define().    */
  963.  
  964.                     case MY_ERROR_VALUE:    /* defined by the programmer */
  965.                         dproc_enter_error( hform );
  966.                         /* display error message, etc. */
  967.                         dproc_exit_error( hform, lParam );
  968.                         return( TRUE );
  969.  
  970.                     case IDOK:
  971.                         dproc_enter_idok( hform );
  972.                         if( !form_in_error_cond( hform ) ) {
  973.                             if( form_validate( hform ) != NULL ) break;
  974.                                 form_process( hform );
  975.                                 EndDialog( hDlg, TRUE );
  976.                                 form_terminate( hform );
  977.                                 /* Perform other IDOK processing. */
  978.                         }
  979.                         return( TRUE );
  980.  
  981.                     case IDCANCEL:
  982.                         dproc_enter_idcancel( hform );
  983.                         EndDialog( hDlg, TRUE );
  984.                         form_terminate( hform );
  985.                         /* Perform other IDCANCEL processing. */
  986.                         return( TRUE );
  987.                 }
  988.                 break;
  989.         }
  990.         return( FALSE );
  991.     }
  992.  
  993.  
  994.     Defining the Form
  995.  
  996.     The definition of a form is performed during WM_INITDIALOG message
  997.     processing in the dialog procedure.  The form_begin and form_end
  998.     functions are required for form definition.  The functions used to
  999.     define controls within the form are field_define, button_define,
  1000.     genctrl_define and statmsg_define. These functions define fields,
  1001.     buttons, generic controls, and status messages respectively.  The calls
  1002.     to these functions must be made between form_begin and form_end.
  1003.  
  1004.     It is recommended that form_begin be called immediately upon entry into
  1005.     WM_INITDIALOG.  If you call any Windows function which generate
  1006.  
  1007.  
  1008.                                       18   
  1009.     WM_COMMAND messages before the form is defined, the form handle returned
  1010.     by form_begin will not be valid and any WM_COMMAND message processing
  1011.     which relies on a valid form handle will fail.
  1012.  
  1013.     If you are planning on adding context-sensitive help to individual
  1014.     controls, you will need to call the form_set_help function somewhere
  1015.     after form_begin.  The form_set_help function sets the Windows Help file
  1016.     name that will be used for context-sensitive help.
  1017.  
  1018.  
  1019.     Defining Fields
  1020.  
  1021.     A field is an edit control within your dialog box and is usually of
  1022.     class "edit".  To define a field, you must call the field_define
  1023.     function for a given edit control.  Not all edit controls have to be
  1024.     defined, but if you want them to have WEDL field capabilities, you
  1025.     should define them.  The purpose of defining a field is to:
  1026.  
  1027.         1.  Assign a picture string to the field.  The picture string
  1028.         defines the size of the field, the allowable characters for each
  1029.         field position, and the placement of formatting characters in the
  1030.         field.  See Appendix A for a list of characters that can be used in
  1031.         picture strings.
  1032.  
  1033.         2.  Optionally assign a variable to the field.  The variable can be
  1034.         initialized or updated by the field.
  1035.  
  1036.         3.  Optionally specify various behavioral features of the field.
  1037.         Such features include numeric formatting, case conversion, space
  1038.         padding, and whether the field belongs to a combo box. See the
  1039.         description of the field_define function for a list of features that
  1040.         can be specified.
  1041.  
  1042.         4.  Optionally assign a validation function to the field.  The
  1043.         validation function is written by you, the programmer, to validate
  1044.         the contents of the field.  See the section on writing field
  1045.         validation functions below for more information.
  1046.  
  1047.         5.  Optionally assign a Windows Help context to the field.  If the
  1048.         user presses F1 in the field, a help screen will be displayed with
  1049.         information on that particular field.  See the section on defining
  1050.         context-sensitive help for more information.
  1051.  
  1052.     The following is an example of a call to field_define:
  1053.  
  1054.         field_define( hform, ID_ACCTNO, &acct_no, DT_INTEGER, "###",
  1055.                       FDF_NUMERIC | FDF_NOTZERO, pcheck_acct_num,
  1056.                       BAD_ACCTNO, HELPID_ACCTNO );
  1057.  
  1058.  
  1059.     Defining Buttons
  1060.  
  1061.     A button is a control within your dialog box that typically has an on or
  1062.  
  1063.  
  1064.                                       19   
  1065.     off state.  The control is usually of class "button" and can be a radio
  1066.     button, check box, or compatible button.  To define a button, you must
  1067.     call the button_define function for a given button control.  Not all
  1068.     button controls have to be defined, but if you want them to have WEDL
  1069.     button capabilities, you should define them.  The purpose of defining a
  1070.     button is to:
  1071.  
  1072.         1.  Optionally assign a variable to the button.  The variable can be
  1073.         set to a value indicating whether the button has been checked or not
  1074.         checked.  The variable can also be set to a value indicating which
  1075.         button in a group of buttons was checked.
  1076.  
  1077.         2.  Optionally initialize the state of the button.  The button can
  1078.         be initialized on, off, grayed (disabled), or can be set according
  1079.         to the value of the variable assigned to the button.
  1080.  
  1081.         3.  Optionally assign a Windows Help context to the button.  If the
  1082.         user presses F1 while on the button, a help screen will be displayed
  1083.         with information on that particular button.  See the section on
  1084.         defining context-sensitive help for more information.
  1085.  
  1086.     Do not use button_define to define a push button.  Since a push button
  1087.     only has an instantaneous "on" state, assigning a variable to the button
  1088.     would be useless.  Use the genctrl_define function for defining push
  1089.     buttons.  The "OK" and "Cancel" buttons are defined by default because
  1090.     WEDL needs to maintain them.
  1091.  
  1092.     The following is an example of a call to button_define where the button
  1093.     is not part of a group:
  1094.  
  1095.         button_define( hform, ID_SAVECHANGES, &bSaveChanges, 0, TRUE, FALSE,
  1096.                        BS_OFF, HELPID_SAVECHANGES );
  1097.  
  1098.     The following calls to button_define demonstrate the definition of a
  1099.     group of 3 related buttons:
  1100.  
  1101.         button_define( hform, ID_XMODEM, &protocol, 1, ID_XMODEM, 0,
  1102.                        BS_USEDATA, HELPID_XMODEM );
  1103.         button_define( hform, ID_YMODEM, &protocol, 1, ID_YMODEM, 0,
  1104.                        BS_USEDATA, HELPID_YMODEM );
  1105.         button_define( hform, ID_ZMODEM, &protocol, 1, ID_ZMODEM, 0,
  1106.                        BS_USEDATA, HELPID_ZMODEM );
  1107.  
  1108.  
  1109.     Defining Generic Controls
  1110.  
  1111.     A generic control can be any control within your dialog box.  It is
  1112.     usually a list box, push button, or custom control.  To define a generic
  1113.     control, you must call the genctrl_define function for a given dialog
  1114.     box control.  The only reasons for defining a generic control are to
  1115.     assign context-sensitive help to it, and to make sure that status
  1116.     messages get updated if the Insert, CapsLock, or NumLock keys are
  1117.     pressed while the control has input focus.
  1118.  
  1119.  
  1120.                                       20   
  1121.  
  1122.     The following is an example of a call to genctrl_define:
  1123.  
  1124.         genctrl_define( hform, ID_LISTBOX, HELPID_LISTBOX );
  1125.  
  1126.  
  1127.     Defining Status Messages
  1128.  
  1129.     In many circumstances, it is desirable to have a status message
  1130.     indicating whether the Insert, CapsLock, or NumLock key is toggled on or
  1131.     off.  WEDL provides a simple method for creating these automatically-
  1132.     updated key status messages.  All you have to do is define a static text
  1133.     control (class "static") in your dialog box to be used for the
  1134.     displaying of the status message.  Then call the statmsg_define function
  1135.     to link the key to the status message.
  1136.  
  1137.     The only drawbacks to these types of status messages is they cannot be
  1138.     updated while the input focus is set to a control not defined by WEDL.
  1139.     When the user moves to a control that has been defined by WEDL, the
  1140.     status message will be updated.
  1141.  
  1142.  
  1143.     Writing Field Validation Functions
  1144.  
  1145.     A field validation function is a function written by you, the
  1146.     programmer, to validate the information in a field. The validation
  1147.     function is called both when the user tries to leave the field and when
  1148.     the user selects "OK". The exception to this rule is when the field has
  1149.     the FDF_VAFFRM feature specified, in which case the validation function
  1150.     is called only when the user selects "OK".  A validation function is
  1151.     assigned to a field by the field_define function.  The validation
  1152.     function must be declared in this form:
  1153.  
  1154.         int FAR PASCAL ValidationFunc( LPSTR pbuf );
  1155.  
  1156.     Since the validation function is a callback function, it must be
  1157.     declared FAR and have an entry in the EXPORTS section of your
  1158.     application's module definition file.
  1159.  
  1160.     The validation function is passed a pointer to a temporary buffer
  1161.     containing a character string in logical field format.  You use this
  1162.     character string to validate the field.  If you need to convert the
  1163.     value to a numeric data type, you can use the field_log_to_data function
  1164.     to do so.  You may also use the atoi, atol, or field_insert_dec/atof
  1165.     functions for converting the string to a numeric data type.
  1166.  
  1167.     When you are done validating the field's contents, you return either
  1168.     zero if the field contains no errors or the position of the error in the
  1169.     field + 1.
  1170.  
  1171.     The following is an example of a validation function that checks an
  1172.     account number and makes sure it is within 100 and 400:
  1173.  
  1174.  
  1175.  
  1176.                                       21   
  1177.         int FAR PASCAL check_acct_num( LPSTR pbuf )
  1178.         {
  1179.             int acctno;
  1180.  
  1181.             acctno = atoi( pbuf );
  1182.             if( acctno < 100 || acctno > 400 ) return( 1 );
  1183.             return( 0 );
  1184.         }
  1185.  
  1186.     Use the validation function only for validating the field.  If you call
  1187.     Windows functions which generate messages, you chance crashing your
  1188.     program.  Modifying the contents of the temporary buffer will not change
  1189.     the contents of the field and is not recommended.
  1190.  
  1191.  
  1192.     Writing Error Handlers
  1193.  
  1194.     For every validation function, there is a corresponding error handler.
  1195.     The error handler is a piece of code that is responsible for displaying
  1196.     an error message, sounding a an audible beep, or any other actions you
  1197.     want to take in the event of an error.  WEDL takes care of repositioning
  1198.     the cursor to the position of the error in the field.
  1199.  
  1200.     The error handler is written in the dialog procedure.  The errval
  1201.     parameter you specified in the call to the field_define function is
  1202.     passed in the wParam parameter of the WM_COMMAND message.  You must call
  1203.     the dproc_enter_error function immediately upon entry into the error
  1204.     handler and dproc_exit_error just before leaving the error handler.  The
  1205.     error handler returns TRUE indicating the dialog procedure handled the
  1206.     message.
  1207.  
  1208.     The following is an example error handler:
  1209.  
  1210.         case BAD_ACCTNO:
  1211.             dproc_enter_error( hform );
  1212.             MessageBeep( 0 );
  1213.             MessageBox( hDlg, "Account number is invalid!", NULL, MB_OK );
  1214.             dproc_exit_error( hform, lParam );
  1215.             return( TRUE );
  1216.  
  1217.  
  1218.     Defining Context-Sensitive Help
  1219.  
  1220.     Context-sensitive help can be applied to controls defined by WEDL.  WEDL
  1221.     uses the standard Windows Help application and F1 key in its
  1222.     implementation.  First you must call the form_set_help function to let
  1223.     WEDL know you'll be using context-sensitive help and to specify the name
  1224.     of the Windows Help file that will be used.  You should call this
  1225.     function somewhere in the dialog procedure's WM_INITDIALOG message
  1226.     processing after form_begin has been called.
  1227.  
  1228.     In the field_define, button_define, and genctrl_define function calls,
  1229.     one of the parameters, help_context, is used to specify the context ID
  1230.  
  1231.  
  1232.                                       22   
  1233.     of the Windows Help topic associated with the control.  If the user
  1234.     presses F1 while in a control with a nonzero help_context, the Windows
  1235.     Help application will be executed.  Then Windows Help will automatically
  1236.     load the help file specified in the form_set_help function and display
  1237.     the topic for the control's help_context.
  1238.  
  1239.     To create a Windows Help file, you'll need a word processing program
  1240.     capable of producing Rich Text Format (.RTF) files and the help compiler
  1241.     included in the Microsoft Windows Software Development Kit. There is
  1242.     plenty of information on this in the Windows SDK documentation, so there
  1243.     is no need to cover this here.
  1244.  
  1245.  
  1246.     Compiling and Linking
  1247.  
  1248.     To create programs that use WEDL, you need the WEDL.H header file, the
  1249.     WEDL-E.DLL library file, and the WEDL-E.LIB import library file.
  1250.  
  1251.     First, you must first compile the source code file(s) into object code
  1252.     file(s).  Sample compiler command lines are:
  1253.  
  1254.         cl -c -AS -Gsw -Ox -Zpe -W3 demo.c
  1255.         bcc -c -ms -w -WS -O -Z demo.c
  1256.  
  1257.     Second, you must link object modules together to create an executable
  1258.     program.  Sample linker command lines are:
  1259.  
  1260.         link /NOD demo, demo, demo, libw slibcew wedl-e, demo
  1261.         tlink /Twe /v /n /c c0ws demo,demo,,cwins cs import maths \
  1262.                 wedl-e, demo
  1263.  
  1264.     Finally, you must bind your resources to your executable program using a
  1265.     resource compiler.  A sample resource compiler command line is:
  1266.  
  1267.         rc demo
  1268.  
  1269.  
  1270.     Executing the Program
  1271.  
  1272.     When executing your program that uses WEDL, the only requirement is that
  1273.     the library file WEDL-E.DLL be in the current directory or in the PATH.
  1274.  
  1275.  
  1276.     Common Programming Errors
  1277.  
  1278.     There are a few common programming errors when using the WEDL library.
  1279.     These include:
  1280.  
  1281.     1.  You have a field that is larger than the character string buffer
  1282.     receiving the fields contents.  For example, if you have a phone number
  1283.     field defined like so:
  1284.  
  1285.         char phone_num[10];             // error - not large enough!
  1286.  
  1287.  
  1288.                                       23   
  1289.         field_define( hform, ID_PHONE, phone_num, DT_STRING,
  1290.                       "'('999')'999'-'9999", FDF_NONE, NULL, 0, 0 );
  1291.  
  1292.     When the user selects "OK", WEDL will copy the contents of the field
  1293.     plus a terminating '\0' character to 'phone_num'.  This means 11
  1294.     characters will be copied to a character string buffer only 10
  1295.     characters wide.  Changing 'phone_num' to an array of 11 characters will
  1296.     fix this problem. Suppose your phone number field is defined like:
  1297.  
  1298.         char phone_num[11];             // error - not large enough!
  1299.         field_define( hform, ID_PHONE, phone_num, DT_STRING,
  1300.                       "'('999')'999'-'9999", FDF_WRPHYS, NULL, 0, 0 );
  1301.  
  1302.     Now you have the same problem, but in a different way.  Since the
  1303.     FDF_WRPHYS feature is being used, the formatting characters '(', ')',
  1304.     and '-' will be copied to 'phone_num' as well.  This means 'phone_num'
  1305.     must be 14 characters wide.
  1306.  
  1307.     2.  Your form handle variable is not declared properly.  The 'hform'
  1308.     variable must be static or global.  Otherwise, it may not work.  This
  1309.     declaration is a no-no:
  1310.  
  1311.         int FAR PASCAL DialogProc( HWND hDlg, unsigned message, WORD wParam,
  1312.                                    LONG lParam )
  1313.         {
  1314.             HFORM hform;            //  error - not static!
  1315.             // ....the rest of the code
  1316.  
  1317.     As soon as WM_INITDIALOG returns, the value of 'hform' will be lost and
  1318.     later when the dproc_enter_wm_command function is called, it will be
  1319.     passed an invalid form handle.  Either change the declaration of 'hform'
  1320.     to static or make 'hform' a global variable.
  1321.  
  1322.     3.  A call to the field_define function keeps failing.  This is most
  1323.     likely occurring because your field's picture string is invalid or is
  1324.     invalid for the given field feature(s).  Check the picture string
  1325.     against the allowable characters listed in Appendix A.
  1326.  
  1327.     4.  You have a field in update mode (FDF_UPDATE or FDF_CONDUPD) and are
  1328.     getting garbage characters in the fields.  For example:
  1329.  
  1330.         char ssn[10];
  1331.         field_define( hform, ID_SOCSEC, ssn, DT_STRING,
  1332.                       "999'-'99'-'9999", FDF_UPDATE, NULL, 0, 0 );
  1333.  
  1334.     Here you would have a problem.  The variable 'ssn' has not been
  1335.     initialized, yet you have the field in update mode.  The field would be
  1336.     initialized with whatever garbage contents 'ssn' happens to contain.
  1337.     Make sure the variables you are updating actually have valid values.
  1338.     Otherwise, do not use update mode.
  1339.  
  1340.     5.  Your program locks up while in your validation function.  This is
  1341.     most likely the result of you calling a Windows function which generates
  1342.  
  1343.  
  1344.                                       24   
  1345.     messages that get sent to either the dialog procedure or the edit
  1346.     control procedure.  Some Windows function calls will work during a
  1347.     validation function; others will not.  You will have to experiment for
  1348.     yourself.
  1349.  
  1350.     6.  The data type you specified in the data_type parameter of the
  1351.     field_define function does not match the data type pointed to by the
  1352.     pdata pointer.  For example:
  1353.  
  1354.         long age;
  1355.         field_define( hform, ID_AGE, &age, DT_INTEGER,
  1356.                       "999", FDF_NONE, NULL, 0, 0 );
  1357.  
  1358.     Here the address of 'age', which is a long, is passed to field_define,
  1359.     yet the data_type was specified as an integer.  This will cause real
  1360.     problems.
  1361.  
  1362.     7.  You defined a combo box field without specifying FDF_COMBO as one of
  1363.     the field's features. The field will not function properly unless
  1364.     FDF_COMBO is specified.
  1365.  
  1366.     8.  You have a combo box field with formatting characters in the picture
  1367.     string.  Normally, the only characters that you should have in a picture
  1368.     string for a combo box field are validation characters. If you do use
  1369.     formatting characters, the strings contained in the combo box's list box
  1370.     must have the same format as the picture string.
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.                                       25   
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.                               Function Reference
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.                                       26   
  1457.  
  1458.     button_define
  1459.  
  1460.     Syntax      HBUTTON    button_define(hform, ctrl_id, pdata, group_id,
  1461.                 on_value, off_value, init_state, help_context)
  1462.  
  1463.                 Defines a button.
  1464.  
  1465.                 Parameter       Type/Description
  1466.                 ---------       ----------------
  1467.                 hform           HFORM    The form's handle.
  1468.  
  1469.                 ctrl_id         int    The dialog control ID of the button
  1470.                                 or check box control being defined.
  1471.  
  1472.                 pdata           LPINT    Pointer to the integer variable
  1473.                                 that will be automatically initialized or
  1474.                                 updated by the button control.  If NULL is
  1475.                                 given, the button will not manipulate any
  1476.                                 variables and the button's value will have
  1477.                                 to be retrieved manually.
  1478.  
  1479.                 group_id        int    An identifier specifying the group
  1480.                                 the button belongs to.  For example, if
  1481.                                 there was a group box containing 2 radio
  1482.                                 buttons, one for "Male" and the other for
  1483.                                 "Female", you'd define both of their buttons
  1484.                                 with the same pdata and group_id.  If the
  1485.                                 button does not belong to a group, set
  1486.                                 group_id to 0.
  1487.  
  1488.                 on_value        int    The value that will be stored at the
  1489.                                 integer pointed to by pdata if the button is
  1490.                                 checked.
  1491.  
  1492.                 off_value       int    The value that will be stored at the
  1493.                                 integer variable pointed to by pdata if the
  1494.                                 button is not checked.  If the button
  1495.                                 control belongs to a group (group_id is
  1496.                                 nonzero), the value given for off_value is
  1497.                                 ignored.
  1498.  
  1499.                 init_state      int    The initial state of the button
  1500.                                 control.  Can be one of the following
  1501.                                 values:
  1502.  
  1503.                                 Value       Meaning
  1504.                                 -----       -------
  1505.                                 BS_OFF      Button will be initialized off
  1506.                                             (not checked).
  1507.  
  1508.                                 BS_ON       Button will be initialized on
  1509.                                             (checked).
  1510.  
  1511.  
  1512.                                       27   
  1513.  
  1514.                                 BS_GRAYED   Button will be grayed (disabled)
  1515.                                             if it is a 3-state button.
  1516.  
  1517.                                 BS_USEDATA  Button will be initialized to
  1518.                                             the value of the integer pointed
  1519.                                             to by pdata.  If the value is
  1520.                                             equal to the on_value, the
  1521.                                             button will be initialized on.
  1522.                                             Otherwise, the button will be
  1523.                                             initialized off.
  1524.  
  1525.                                 BS_NOTSET   Button's state will not be set.
  1526.  
  1527.                 help_context    DWORD    The help context identifier of the
  1528.                                 Windows Help topic associated with the
  1529.                                 button.  If context-sensitive help is not
  1530.                                 being applied to the button, set
  1531.                                 help_context to 0.  If context-sensitive
  1532.                                 help is being applied to the button, the
  1533.                                 form_set_help function must be called prior
  1534.                                 to the F1 key being pressed.
  1535.  
  1536.     Return Value    The handle of the new button's record or NULL if an
  1537.                     error occurred.  An error can be caused by one of the
  1538.                     following conditions:
  1539.  
  1540.                         Control ID is invalid.
  1541.                         The form_end function has already been called.
  1542.                         Memory allocation error.
  1543.  
  1544.     ________________________________________________________________________
  1545.  
  1546.     button_get_check
  1547.  
  1548.     Syntax      int    button_get_check(hbutton)
  1549.  
  1550.                 Gets the check state of a button.
  1551.  
  1552.                 Parameter       Type/Description
  1553.                 ---------       ----------------
  1554.                 hbutton         HBUTTON    The button's handle.
  1555.  
  1556.     Return Value    BS_OFF if the button is off (not checked), BS_ON if the
  1557.                     button is on (checked), or -1 if an error occurred.
  1558.  
  1559.     ________________________________________________________________________
  1560.  
  1561.     button_get_from_ctrl_id
  1562.  
  1563.     Syntax      HBUTTON    button_get_from_ctrl_id(hform, ctrl_id)
  1564.  
  1565.                 Gets the handle of a button using its dialog control ID as
  1566.  
  1567.  
  1568.                                       28   
  1569.                 input.
  1570.  
  1571.                 Parameter       Type/Description
  1572.                 ---------       ----------------
  1573.                 hform           HFORM    The form's handle.
  1574.  
  1575.                 ctrl_id         int    The dialog control ID of the control
  1576.                                 the button is associated with.
  1577.  
  1578.     Return Value    The handle of the button associated with the input
  1579.                     dialog control ID or NULL if an error occurred.
  1580.  
  1581.     ________________________________________________________________________
  1582.  
  1583.     button_get_from_group
  1584.  
  1585.     Syntax      HBUTTON    button_get_from_group(hform, group_id)
  1586.  
  1587.                 Gets the handle of the checked button in a group of buttons.
  1588.  
  1589.                 Parameter       Type/Description
  1590.                 ---------       ----------------
  1591.                 hform           HFORM    The form's handle.
  1592.  
  1593.                 group_id        int    The group ID of the group of buttons
  1594.                                 to test.
  1595.  
  1596.     Return Value    The handle of the button that is checked or NULL if an
  1597.                     error occurred.
  1598.  
  1599.     ________________________________________________________________________
  1600.  
  1601.     button_get_from_hwnd
  1602.  
  1603.     Syntax      HBUTTON    button_get_from_hwnd(hform, hWnd)
  1604.  
  1605.                 Gets the handle of a button using the window handle of its
  1606.                 control as input.
  1607.  
  1608.                 Parameter       Type/Description
  1609.                 ---------       ----------------
  1610.                 hform           HFORM    The form's handle.
  1611.  
  1612.                 hWnd            HWND    The window handle of the control
  1613.                                 associated with the button.
  1614.  
  1615.     Return Value    The handle of the button associated with the input
  1616.                     window handle or NULL if an error occurred.
  1617.  
  1618.     ________________________________________________________________________
  1619.  
  1620.     button_has_changed
  1621.  
  1622.  
  1623.  
  1624.                                       29   
  1625.     Syntax      int    button_has_changed(hbutton)
  1626.  
  1627.                 Determines whether a button has been changed by the user.
  1628.  
  1629.                 Parameter       Type/Description
  1630.                 ---------       ----------------
  1631.                 hbutton         HBUTTON    The button's handle.
  1632.  
  1633.     Return Value    TRUE if the user has changed the button, FALSE if the
  1634.                     user has not changed the button, or -1 if an error
  1635.                     occurred.
  1636.  
  1637.     ________________________________________________________________________
  1638.  
  1639.     button_lock
  1640.  
  1641.     Syntax      LPBUTTON    button_lock(hbutton)
  1642.  
  1643.                 Locks a button's record in memory so it can be accessed.
  1644.  
  1645.                 Parameter       Type/Description
  1646.                 ---------       ----------------
  1647.                 hbutton         HBUTTON    The button's handle.
  1648.  
  1649.     Return Value    A far pointer to the button's record or NULL if an error
  1650.                     occurred.  See the description for the BUTTON struct for
  1651.                     details.
  1652.  
  1653.     Comments    Once you have obtained a pointer to the button's record, you
  1654.                 are able to read or change any of the record's elements.
  1655.                 However, it is not recommended that you change the values of
  1656.                 any of the elements.
  1657.  
  1658.                 When you are done accessing the button's record, be sure to
  1659.                 call button_unlock.
  1660.  
  1661.                 Calling this function locks the button's record in the
  1662.                 .DLL's local heap.  In addition, the .DLL's entire data
  1663.                 segment is locked in the global heap.  This is required to
  1664.                 ensure the returned far pointer will remain valid until the
  1665.                 call to button_unlock.  For this reason, you should not keep
  1666.                 the button locked any longer than absolutely necessary.
  1667.  
  1668.     ________________________________________________________________________
  1669.  
  1670.     button_set_check
  1671.  
  1672.     Syntax      int    button_set_check(hbutton, state)
  1673.  
  1674.                 Sets the check state of a button.
  1675.  
  1676.                 Parameter       Type/Description
  1677.                 ---------       ----------------
  1678.  
  1679.  
  1680.                                       30   
  1681.                 hbutton         HBUTTON    The button's handle.
  1682.  
  1683.                 state           int    The state to set the button control
  1684.                                 to.  See the description of the
  1685.                                 button_define function for a list of valid
  1686.                                 state values.
  1687.  
  1688.     Return Value    Nonzero if an error occurred.
  1689.  
  1690.     ________________________________________________________________________
  1691.  
  1692.     button_unlock
  1693.  
  1694.     Syntax      void    button_unlock(hbutton)
  1695.  
  1696.                 Unlocks a button's record in memory.
  1697.  
  1698.                 Parameter       Type/Description
  1699.                 ---------       ----------------
  1700.                 hbutton         HBUTTON    The button's handle.
  1701.  
  1702.     Return Value    None.
  1703.  
  1704.     ________________________________________________________________________
  1705.  
  1706.     char_is_printable
  1707.  
  1708.     Syntax      BOOL    char_is_printable(ch)
  1709.  
  1710.                 Determines whether a character is printable.  This
  1711.                 determination is made based upon Windows' current language
  1712.                 driver settings.
  1713.  
  1714.                 Parameter       Type/Description
  1715.                 ---------       ----------------
  1716.                 ch              int    The character to test.
  1717.  
  1718.     Return Value    TRUE if the character is printable; otherwise FALSE.
  1719.  
  1720.     ________________________________________________________________________
  1721.  
  1722.     char_to_lower
  1723.  
  1724.     Syntax      int    char_to_lower(ch)
  1725.  
  1726.                 Converts a character to lowercase.  This conversion is made
  1727.                 based upon Windows' current language driver settings.
  1728.  
  1729.                 Parameter       Type/Description
  1730.                 ---------       ----------------
  1731.                 ch              int    The character to convert.
  1732.  
  1733.     Return Value    The converted character.
  1734.  
  1735.  
  1736.                                       31   
  1737.  
  1738.     ________________________________________________________________________
  1739.  
  1740.     char_to_upper
  1741.  
  1742.     Syntax      int    char_to_upper(ch)
  1743.  
  1744.                 Converts a character to uppercase.  This conversion is made
  1745.                 based upon Windows' current language driver settings.
  1746.  
  1747.                 Parameter       Type/Description
  1748.                 ---------       ----------------
  1749.                 ch              int    The character to convert.
  1750.  
  1751.     Return Value    The converted character.
  1752.  
  1753.     ________________________________________________________________________
  1754.  
  1755.     dproc_enter_error
  1756.  
  1757.     Syntax      int    dproc_enter_error(hform)
  1758.  
  1759.                 This function is part of the dialog procedure's framework.
  1760.                 It must be the first function called in a field's error
  1761.                 handler.
  1762.  
  1763.                 Parameter       Type/Description
  1764.                 ---------       ----------------
  1765.                 hform           HFORM    The form's handle.
  1766.  
  1767.     Return Value    Nonzero if an error occurred.
  1768.  
  1769.     ________________________________________________________________________
  1770.  
  1771.     dproc_enter_idcancel
  1772.  
  1773.     Syntax      int    dproc_enter_idcancel(hform)
  1774.  
  1775.                 This function is part of the dialog procedure's framework.
  1776.                 It must be the first function called in the IDCANCEL
  1777.                 processing of the WM_COMMAND message.
  1778.  
  1779.                 Parameter       Type/Description
  1780.                 ---------       ----------------
  1781.                 hform           HFORM    The form's handle.
  1782.  
  1783.     Return Value    Nonzero if an error occurred.
  1784.  
  1785.     ________________________________________________________________________
  1786.  
  1787.     dproc_enter_idok
  1788.  
  1789.     Syntax      int    dproc_enter_idok(hform)
  1790.  
  1791.  
  1792.                                       32   
  1793.  
  1794.                 This function is part of the dialog procedure's framework.
  1795.                 It must be the first function called in the IDOK processing
  1796.                 of the WM_COMMAND message.
  1797.  
  1798.                 Parameter       Type/Description
  1799.                 ---------       ----------------
  1800.                 hform           HFORM    The form's handle.
  1801.  
  1802.     Return Value    Nonzero if an error occurred.
  1803.  
  1804.     ________________________________________________________________________
  1805.  
  1806.     dproc_enter_wm_command
  1807.  
  1808.     Syntax      int    dproc_enter_wm_command(hform, wParam, lParam)
  1809.  
  1810.                 This function is part of the dialog procedure's framework.
  1811.                 It must be the first function called in the WM_COMMAND
  1812.                 message processing.
  1813.  
  1814.                 Parameter       Type/Description
  1815.                 ---------       ----------------
  1816.                 hform           HFORM    The form's handle.
  1817.  
  1818.                 wParam          unsigned    The wParam parameter passed to
  1819.                                 the dialog procedure by Windows.
  1820.  
  1821.                 lParam          LONG    The lParam parameter passed to the
  1822.                                 dialog procedure by Windows.
  1823.  
  1824.     Return Value    Nonzero if an error occurred.
  1825.  
  1826.     ________________________________________________________________________
  1827.  
  1828.     dproc_exit_error
  1829.  
  1830.     Syntax      int    dproc_exit_error(hform, lParam)
  1831.  
  1832.                 This function is part of the dialog procedure's framework.
  1833.                 It must be the last function called in a field's error
  1834.                 handler.
  1835.  
  1836.                 Parameter       Type/Description
  1837.                 ---------       ----------------
  1838.                 hform           HFORM    The form's handle.
  1839.  
  1840.                 lParam          LONG    The lParam parameter passed to the
  1841.                                 dialog procedure by Windows.
  1842.  
  1843.     Return Value    Nonzero if an error occurred.
  1844.  
  1845.     ________________________________________________________________________
  1846.  
  1847.  
  1848.                                       33   
  1849.  
  1850.     field_data_to_log
  1851.  
  1852.     Syntax      int    field_data_to_log(hfield, pbuf, pdata, data_type)
  1853.  
  1854.                 Converts a value in a specified data type to a character
  1855.                 string in logical field format.
  1856.  
  1857.                 Parameter       Type/Description
  1858.                 ---------       ----------------
  1859.                 hfield          HFIELD    The field's handle.
  1860.  
  1861.                 pbuf            LPSTR    Pointer to the buffer to receive
  1862.                                 the converted value.
  1863.  
  1864.                 pdata           LPVOID    Pointer to the data item to
  1865.                                 containing the data to convert. This
  1866.                                 parameter can point to one of the following
  1867.                                 types:  char (string), int, unsigned, long,
  1868.                                 unsigned long, or double.  The value you
  1869.                                 give for the data_type parameter must
  1870.                                 correspond to the data pointed to by pdata.
  1871.  
  1872.                 data_type       int    Specifies the data type pdata points
  1873.                                 to.  See the description of the field_define
  1874.                                 function for a list of possible values.
  1875.  
  1876.     Return Value    Nonzero if an error occurred.
  1877.  
  1878.     ________________________________________________________________________
  1879.  
  1880.     field_define
  1881.  
  1882.     Syntax      HFIELD    field_define(hform, ctrl_id, pdata, data_type,
  1883.                 picture_string, features, pvalid_func, error_value,
  1884.                 help_context)
  1885.  
  1886.                 Defines a field.  This function is called for each edit
  1887.                 control in your dialog box you want to define.
  1888.  
  1889.                 Parameter       Type/Description
  1890.                 ---------       ----------------
  1891.                 hform           HFORM    The form's handle.
  1892.  
  1893.                 ctrl_id         int    The dialog control ID of the edit
  1894.                                 control you want to define.
  1895.  
  1896.                 pdata           LPVOID    Pointer to the data item you are
  1897.                                 going to initialize or update. This
  1898.                                 parameter can point to one of the following
  1899.                                 types:  char (string), int, unsigned, long,
  1900.                                 unsigned long, or double.  It can also be
  1901.                                 NULL if you do not want any data modified by
  1902.  
  1903.  
  1904.                                       34   
  1905.                                 the field.  The value you give for the
  1906.                                 data_type parameter must correspond to the
  1907.                                 data pointed to by pdata.
  1908.  
  1909.                 data_type       int    Specifies the data type pdata points
  1910.                                 to.  Can be one of the following values:
  1911.  
  1912.                                 Value       Meaning
  1913.                                 -----       -------
  1914.                                 DT_NULL     The pdata parameter is NULL.
  1915.  
  1916.                                 DT_STRING   pdata points to a character
  1917.                                             string.  The string must be
  1918.                                             terminated with a '\0' if you
  1919.                                             are updating existing data.
  1920.  
  1921.                                 DT_INTEGER  pdata points to a signed
  1922.                                             integer.
  1923.  
  1924.                                 DT_UNSIGNED pdata points to an unsigned
  1925.                                             integer.
  1926.  
  1927.                                 DT_LONG     pdata points to a signed long
  1928.                                             integer.
  1929.  
  1930.                                 DT_ULONG    pdata points to an unsigned long
  1931.                                             integer.
  1932.  
  1933.                                 DT_DOUBLE   pdata points to a double-
  1934.                                             precision real number.
  1935.  
  1936.                 picture_string  LPSTR    The field's picture string.  The
  1937.                                 picture string describes the allowable
  1938.                                 characters for each position in the field,
  1939.                                 the size of the field, and the positioning
  1940.                                 of the formatting characters.  See Appendix
  1941.                                 A for a list of characters you can use in
  1942.                                 the picture string.
  1943.  
  1944.                 features        DWORD    One or more features describing how
  1945.                                 the field should behave.  You can combine
  1946.                                 features with the bitwise OR operator. Can
  1947.                                 be one or more of the following values:
  1948.  
  1949.                                 Value           Meaning
  1950.                                 -----           -------
  1951.                                 FDF_NONE        No features defined.
  1952.  
  1953.                                 FDF_COMPLETE    Field must be complete (no
  1954.                                                 blanks allowed unless
  1955.                                                 specified in the picture
  1956.                                                 string).
  1957.  
  1958.  
  1959.  
  1960.                                       35   
  1961.                                 FDF_NOTBLANK    Field cannot be blank.
  1962.  
  1963.                                 FDF_NOTZERO     Field cannot be zero.
  1964.  
  1965.                                 FDF_NOTEDIT     Field cannot be edited.
  1966.                                                 Normally this feature is
  1967.                                                 combined with FDF_UPDATE.
  1968.  
  1969.                                 FDF_MUSTEDIT    Field must be edited.
  1970.  
  1971.                                 FDF_UPDATE      Update existing data.  This
  1972.                                                 initializes the edit control
  1973.                                                 with the data pointed to by
  1974.                                                 pdata.
  1975.  
  1976.                                 FDF_CONDUPD     Conditionally update
  1977.                                                 existing data.  This
  1978.                                                 initializes the edit control
  1979.                                                 with the data pointed to by
  1980.                                                 pdata.  When the user enters
  1981.                                                 the field, the cursor is
  1982.                                                 placed after the last
  1983.                                                 character in the field.  If
  1984.                                                 a character is entered, the
  1985.                                                 field is cleared and the
  1986.                                                 cursor is placed in the
  1987.                                                 first position of the field.
  1988.                                                 If an editing key is
  1989.                                                 pressed, the field is set to
  1990.                                                 update mode.
  1991.  
  1992.                                 FDF_SPCFILL     Space-fill field from the
  1993.                                                 right.  The data_type must
  1994.                                                 be DT_STRING.
  1995.  
  1996.                                 FDF_ZEROFILL    Zero-fill numeric field from
  1997.                                                 the left. FDF_NUMERIC or
  1998.                                                 FDF_CALCNUM must also be
  1999.                                                 specified.
  2000.  
  2001.                                 FDF_BLNKZERO    Blank numeric field if equal
  2002.                                                 to zero. FDF_NUMERIC or
  2003.                                                 FDF_CALCNUM must also be
  2004.                                                 specified.
  2005.  
  2006.                                 FDF_RDPHYS      The DT_STRING variable
  2007.                                                 pointed to by pdata is
  2008.                                                 already in physical field
  2009.                                                 format (has embedded
  2010.                                                 formatting characters).
  2011.  
  2012.                                 FDF_WRPHYS      Merges a DT_STRING field's
  2013.                                                 formatting characters into
  2014.  
  2015.  
  2016.                                       36   
  2017.                                                 its logical contents when
  2018.                                                 storing it.  The destination
  2019.                                                 character buffer will then
  2020.                                                 contain the field's physical
  2021.                                                 contents.
  2022.  
  2023.                                 FDF_UPPER       Characters enters into the
  2024.                                                 field will be converted to
  2025.                                                 uppercase.
  2026.  
  2027.                                 FDF_LOWER       Characters entered into the
  2028.                                                 field will be converted to
  2029.                                                 lowercase.
  2030.  
  2031.                                 FDF_MIXED       Characters entered into the
  2032.                                                 field will be converted to
  2033.                                                 uppercase or lowercase
  2034.                                                 depending upon the previous
  2035.                                                 character.  The Shift keys
  2036.                                                 override the conversion.
  2037.  
  2038.                                 FDF_NUMERIC     Field is a standard numeric
  2039.                                                 field.
  2040.  
  2041.                                 FDF_CALCNUM     Field is a calculator-style
  2042.                                                 numeric field. Digits to the
  2043.                                                 left of the decimal are
  2044.                                                 shifted to the left as
  2045.                                                 digits are entered.
  2046.  
  2047.                                 FDF_VAFFLD      Do not perform validation
  2048.                                                 until the user tries to
  2049.                                                 leave the field.
  2050.  
  2051.                                 FDF_VAFFRM      Do not perform validation
  2052.                                                 until the user selects "OK".
  2053.  
  2054.                                 FDF_COMBO       Field belongs to a combo
  2055.                                                 box. Use caution when
  2056.                                                 defining a combo box field
  2057.                                                 with embedded formatting
  2058.                                                 characters - strings in the
  2059.                                                 combo box's list box must
  2060.                                                 have the same format as the
  2061.                                                 picture string.
  2062.  
  2063.                 pvalid_func     int (FAR PASCAL *) (LPSTR)    The procedure-
  2064.                                 instance address of the field's validation
  2065.                                 function or NULL if there is no validation
  2066.                                 function. This cannot be the address of the
  2067.                                 validation function itself. A procedure-
  2068.                                 instance address must be created using
  2069.                                 MakeProcInstance and this is the value given
  2070.  
  2071.  
  2072.                                       37   
  2073.                                 here.  See the following "Comments" section
  2074.                                 for details.
  2075.  
  2076.                 error_value     int    This is the value that is passed to
  2077.                                 the dialog procedure when the validation
  2078.                                 function returns an error.  The error_value
  2079.                                 is located in the wParam parameter of the
  2080.                                 WM_COMMAND message sent to the dialog
  2081.                                 procedure.  If pvalid_func is NULL, the
  2082.                                 value given for error_value is ignored.
  2083.  
  2084.                 help_context    DWORD    The help context identifier of the
  2085.                                 Windows Help topic associated with the
  2086.                                 field.  If context-sensitive help is not
  2087.                                 being applied to the field, set help_context
  2088.                                 to 0.  If context-sensitive help is being
  2089.                                 applied to the field, the form_set_help
  2090.                                 function must be called prior to the F1 key
  2091.                                 being pressed.
  2092.  
  2093.     Return Value    The handle of the new field's record or NULL if an error
  2094.                     occurred.  An error can be caused by one of the
  2095.                     following conditions:
  2096.  
  2097.                         Picture string is invalid or invalid for the
  2098.                         specified field feature(s).
  2099.                         Control ID is invalid.
  2100.                         The form_end function has already been called.
  2101.                         Memory allocation error.
  2102.  
  2103.     Comments    You must make all calls to this function during your dialog
  2104.                 procedure's WM_INITDIALOG message processing between the
  2105.                 calls to form_begin and form_end.
  2106.  
  2107.                 The validation function must use the Pascal calling
  2108.                 convention and must be declared FAR.  The validation
  2109.                 function must have the following form:
  2110.  
  2111.     Validation  int FAR PASCAL ValidationFunc(LPSTR pbuf)
  2112.     Function
  2113.                 ValidationFunc represents the validation function's name.
  2114.                 The name of the validation function must be listed in an
  2115.                 EXPORTS statement in the program's module definition file.
  2116.                 pbuf represents the validation function's parameter name.
  2117.  
  2118.                 The validation function is used to validate a field.  When
  2119.                 the user tries to leave the field, ValidationFunc is called
  2120.                 and passed a pointer, pbuf, which points to a buffer
  2121.                 containing the current logical contents of the field.  The
  2122.                 ValidationFunc then validates the field's logical contents
  2123.                 and returns zero if no error was found or the logical
  2124.                 position of the error + 1.
  2125.  
  2126.  
  2127.  
  2128.                                       38   
  2129.                 Parameter       Description
  2130.                 ---------       -----------
  2131.                 pbuf            Pointer to the buffer containing the field's
  2132.                                 current logical contents.
  2133.  
  2134.                 Return Value
  2135.  
  2136.                 Zero if the field passed validation, or the logical position
  2137.                 of the error in the field + 1.
  2138.  
  2139.                 Comments
  2140.  
  2141.                 Modifying the data pointed to by pbuf will have no effect on
  2142.                 the contents of the field.
  2143.  
  2144.     ________________________________________________________________________
  2145.  
  2146.     field_disable_feature
  2147.  
  2148.     Syntax      int    field_disable_feature(hfield, feature)
  2149.  
  2150.                 Disables one or more of a field's features.
  2151.  
  2152.                 Parameter       Type/Description
  2153.                 ---------       ----------------
  2154.                 hfield          HFIELD    The field's handle.
  2155.  
  2156.                 feature         DWORD    The feature to disable.  To disable
  2157.                                 multiple features, combine them with the
  2158.                                 bitwise OR operator.  See the description of
  2159.                                 the field_define function for a list of
  2160.                                 features that can be specified.
  2161.  
  2162.     Return Value    Nonzero if an error occurred.
  2163.  
  2164.     ________________________________________________________________________
  2165.  
  2166.     field_enable_feature
  2167.  
  2168.     Syntax      int    field_enable_feature(hfield, feature)
  2169.  
  2170.                 Enables one or more of a field's features.
  2171.  
  2172.                 Parameter       Type/Description
  2173.                 ---------       ----------------
  2174.                 hfield          HFIELD    The field's handle.
  2175.  
  2176.                 feature         DWORD    The feature to enable.  To enable
  2177.                                 multiple features, combine them with the
  2178.                                 bitwise OR operator.  See the description of
  2179.                                 the field_define function for a list of
  2180.                                 features that can be specified.
  2181.  
  2182.  
  2183.  
  2184.                                       39   
  2185.     Return Value    Nonzero if an error occurred.
  2186.  
  2187.     ________________________________________________________________________
  2188.  
  2189.     field_get_character
  2190.  
  2191.     Syntax      int    field_get_character(hfield, position, physical)
  2192.  
  2193.                 Gets a character from the contents of a field.
  2194.  
  2195.                 Parameter       Type/Description
  2196.                 ---------       ----------------
  2197.                 hfield          HFIELD    The field's handle.
  2198.  
  2199.                 position        int    The logical or physical position from
  2200.                                 which the character will be retrieved.
  2201.  
  2202.                 physical        BOOL    TRUE if position is a physical
  2203.                                 position.  FALSE if position is a logical
  2204.                                 position.
  2205.  
  2206.     Return Value    The specified character or -1 if an error occurred.
  2207.  
  2208.     ________________________________________________________________________
  2209.  
  2210.     field_get_decimal_pos
  2211.  
  2212.     Syntax      int    field_get_decimal_pos(hfield)
  2213.  
  2214.                 Gets the virtual logical position of the decimal point in a
  2215.                 field.  For example if a field had a picture string of
  2216.                 "####.##", the virtual logical position of the decimal point
  2217.                 would be 4. For "###", it would be 3.
  2218.  
  2219.                 Parameter       Type/Description
  2220.                 ---------       ----------------
  2221.                 hfield          HFIELD    The field's handle.
  2222.  
  2223.     Return Value    The virtual logical position of the decimal point or -1
  2224.                     if an error occurred.
  2225.  
  2226.     ________________________________________________________________________
  2227.  
  2228.     field_get_from_ctrl_id
  2229.  
  2230.     Syntax      HFIELD    field_get_from_ctrl_id(hform, ctrl_id)
  2231.  
  2232.                 Gets the handle for a field associated with a given dialog
  2233.                 control ID.
  2234.  
  2235.                 Parameter       Type/Description
  2236.                 ---------       ----------------
  2237.                 hform           HFORM    The form's handle.
  2238.  
  2239.  
  2240.                                       40   
  2241.  
  2242.                 ctrl_id         int    The dialog control ID of the field's
  2243.                                 edit control.
  2244.  
  2245.     Return Value    The handle of the field associated with the input dialog
  2246.                     control ID or NULL if an error occurred.
  2247.  
  2248.     ________________________________________________________________________
  2249.  
  2250.     field_get_from_hwnd
  2251.  
  2252.     Syntax      HFIELD    field_get_from_hwnd(hform, hWnd)
  2253.  
  2254.                 Gets the handle for a field associated with a given edit
  2255.                 control's window handle.
  2256.  
  2257.                 Parameter       Type/Description
  2258.                 ---------       ----------------
  2259.                 hform           HFORM    The form's handle.
  2260.  
  2261.                 hWnd            HWND    The window handle of the field's
  2262.                                 edit control.
  2263.  
  2264.     Return Value    The handle of the field associated with the input window
  2265.                     handle or NULL if an error occurred.
  2266.  
  2267.     ________________________________________________________________________
  2268.  
  2269.     field_get_pos_info
  2270.  
  2271.     Syntax      int    field_get_pos_info(hfield, logical_position, pfpos)
  2272.  
  2273.                 Gets information related to a field's logical position.
  2274.                 This information includes the physical position, selection,
  2275.                 picture string position, validation character, validation
  2276.                 character occurrence, and which side of the decimal point
  2277.                 the position lies.
  2278.  
  2279.                 Parameter           Type/Description
  2280.                 ---------           ----------------
  2281.                 hfield              HFIELD    The field's handle.
  2282.  
  2283.                 logical_position    int    The logical position to get
  2284.                                     information for.
  2285.  
  2286.                 pfpos               LPFIELD_POS    A pointer to the
  2287.                                     FIELD_POS struct which will receive the
  2288.                                     information.  See the description of the
  2289.                                     FIELD_POS structure for details.
  2290.  
  2291.     Return Value    Nonzero if an error occurred.
  2292.  
  2293.     ________________________________________________________________________
  2294.  
  2295.  
  2296.                                       41   
  2297.  
  2298.     field_get_position
  2299.  
  2300.     Syntax      int    field_get_position(hfield, pfpos)
  2301.  
  2302.                 Gets information related to the current position in a field.
  2303.                 This information includes the logical position, physical
  2304.                 position, selection, picture string position, validation
  2305.                 character, validation character occurrence, and which side
  2306.                 of the decimal point the position lies.
  2307.  
  2308.                 Parameter       Type/Description
  2309.                 ---------       ----------------
  2310.                 hfield          HFIELD    The field's handle.
  2311.  
  2312.                 pfpos           LPFIELD_POS    A pointer to the FIELD_POS
  2313.                                 struct which will receive the information.
  2314.                                 See the description of the FIELD_POS
  2315.                                 structure for details.
  2316.  
  2317.     Return Value    Nonzero if an error occurred.
  2318.  
  2319.     Comments    The field identified by hfield must have the focus when
  2320.                 calling this function.
  2321.  
  2322.     ________________________________________________________________________
  2323.  
  2324.     field_get_text
  2325.  
  2326.     Syntax      int    field_get_text(hfield, pbuf, physical)
  2327.  
  2328.                 Gets the contents of a field.
  2329.  
  2330.                 Parameter       Type/Description
  2331.                 ---------       ----------------
  2332.                 hfield          HFIELD    The field's handle.
  2333.  
  2334.                 pbuf            LPSTR    Pointer to the buffer to receives
  2335.                                 the field's contents.
  2336.  
  2337.                 physical        BOOL    TRUE specifies physical contents are
  2338.                                 to be copied to pbuf. FALSE specifies
  2339.                                 logical contents are to be copied.
  2340.  
  2341.     Return Value    Nonzero if an error occurred.
  2342.  
  2343.     ________________________________________________________________________
  2344.  
  2345.     field_has_changed
  2346.  
  2347.     Syntax      int    field_has_changed(hfield)
  2348.  
  2349.                 Determines whether a field has been edited by the user.
  2350.  
  2351.  
  2352.                                       42   
  2353.  
  2354.                 Parameter       Type/Description
  2355.                 ---------       ----------------
  2356.                 hfield          HFIELD    The field's handle.
  2357.  
  2358.     Return Value    TRUE if the user has edited the field, FALSE if the user
  2359.                     has not edited the field, or -1 if an error occurred.
  2360.  
  2361.     ________________________________________________________________________
  2362.  
  2363.     field_insert_decimal
  2364.  
  2365.     Syntax      int    field_insert_decimal(hfield, pbuf)
  2366.  
  2367.                 Inserts a decimal point into a buffer containing a numeric
  2368.                 field's logical contents.
  2369.  
  2370.                 Parameter       Type/Description
  2371.                 ---------       ----------------
  2372.                 hfield          HFIELD    The field's handle.
  2373.  
  2374.                 pbuf            LPSTR    Pointer to the buffer containing
  2375.                                 the field's logical contents.
  2376.  
  2377.     Return Value    Nonzero if an error occurred.
  2378.  
  2379.     Comments    The resulting value in the buffer can be converted to a
  2380.                 double by calling the atof function.  This is useful in
  2381.                 validation functions.
  2382.  
  2383.     ________________________________________________________________________
  2384.  
  2385.     field_lock
  2386.  
  2387.     Syntax      LPFIELD    field_lock(hfield)
  2388.  
  2389.                 Locks a field's record in memory so it can be accessed.
  2390.  
  2391.                 Parameter       Type/Description
  2392.                 ---------       ----------------
  2393.                 hfield          HFIELD    The field's handle.
  2394.  
  2395.     Return Value    A far pointer to the field's record or NULL if an error
  2396.                     occurred.  See the description for the FIELD struct for
  2397.                     details.
  2398.  
  2399.     Comments    Once you have obtained a pointer to the field's record, you
  2400.                 are able to read or change any of the record's elements.
  2401.                 However, it is not recommended that you change the values of
  2402.                 any of the elements.
  2403.  
  2404.                 When you are done accessing the field's record, be sure to
  2405.                 call field_unlock.
  2406.  
  2407.  
  2408.                                       43   
  2409.  
  2410.                 Calling this function locks the field's record in the .DLL's
  2411.                 local heap.  In addition, the .DLL's entire data segment is
  2412.                 locked in the global heap.  This is required to ensure the
  2413.                 returned far pointer will remain valid until the call to
  2414.                 field_unlock.  For this reason, you should not keep the
  2415.                 field locked any longer than absolutely necessary.
  2416.  
  2417.     ________________________________________________________________________
  2418.  
  2419.     field_log_to_data
  2420.  
  2421.     Syntax      int    field_log_to_data(hfield, pbuf, pdata, data_type)
  2422.  
  2423.                 Converts a character string in logical field format to a
  2424.                 value in a specified data type.
  2425.  
  2426.                 Parameter       Type/Description
  2427.                 ---------       ----------------
  2428.                 hfield          HFIELD    The field's handle.
  2429.  
  2430.                 pbuf            LPSTR    Pointer to the buffer containing
  2431.                                 the string to convert.
  2432.  
  2433.                 pdata           LPVOID    Pointer to the data item to
  2434.                                 receive the converted value. This parameter
  2435.                                 can point to one of the following types:
  2436.                                 char (string), int, unsigned, long, unsigned
  2437.                                 long, or double.  The value you give for the
  2438.                                 data_type parameter must correspond to the
  2439.                                 data pointed to by pdata.
  2440.  
  2441.                 data_type       int    Specifies the data type pdata points
  2442.                                 to.  See the description of the field_define
  2443.                                 function for a list of possible values.
  2444.  
  2445.     Return Value    Nonzero if an error occurred.
  2446.  
  2447.     ________________________________________________________________________
  2448.  
  2449.     field_log_to_phys
  2450.  
  2451.     Syntax      int    field_log_to_phys(hfield, pbuf)
  2452.  
  2453.                 Converts a character string in logical field format to
  2454.                 physical field format.
  2455.  
  2456.                 Parameter       Type/Description
  2457.                 ---------       ----------------
  2458.                 hfield          HFIELD    The field's handle.
  2459.  
  2460.                 pbuf            LPSTR    Pointer to the buffer containing
  2461.                                 the string to convert.
  2462.  
  2463.  
  2464.                                       44   
  2465.  
  2466.     Return Value    Nonzero if an error occurred.
  2467.  
  2468.     ________________________________________________________________________
  2469.  
  2470.     field_phys_to_log
  2471.  
  2472.     Syntax      int    field_phys_to_log(hfield, pbuf)
  2473.  
  2474.                 Converts a character string in physical field format to
  2475.                 logical field format.
  2476.  
  2477.                 Parameter       Type/Description
  2478.                 ---------       ----------------
  2479.                 hfield          HFIELD    The field's handle.
  2480.  
  2481.                 pbuf            LPSTR    Pointer to the buffer containing
  2482.                                 the string to convert.
  2483.  
  2484.     Return Value    Nonzero if an error occurred.
  2485.  
  2486.     ________________________________________________________________________
  2487.  
  2488.     field_set_text
  2489.  
  2490.     Syntax      int    field_set_text(hfield, pbuf, physical)
  2491.  
  2492.                 Sets the contents of a field.
  2493.  
  2494.                 Parameter       Type/Description
  2495.                 ---------       ----------------
  2496.                 hfield          HFIELD    The field's handle.
  2497.  
  2498.                 pbuf            LPSTR    Pointer to the buffer containing
  2499.                                 the string to be used for the field's
  2500.                                 contents.
  2501.  
  2502.                 physical        BOOL    TRUE if the string pointed to by
  2503.                                 pbuf is in physical field format. FALSE if
  2504.                                 the string is in logical field format.
  2505.  
  2506.     Return Value    Nonzero if an error occurred.
  2507.  
  2508.     ________________________________________________________________________
  2509.  
  2510.     field_unlock
  2511.  
  2512.     Syntax      void    field_unlock(hfield)
  2513.  
  2514.                 Unlocks a field's record in memory.
  2515.  
  2516.                 Parameter       Type/Description
  2517.                 ---------       ----------------
  2518.  
  2519.  
  2520.                                       45   
  2521.                 hfield          HFIELD    The field's handle.
  2522.  
  2523.     Return Value    None.
  2524.  
  2525.     ________________________________________________________________________
  2526.  
  2527.     form_begin
  2528.  
  2529.     Syntax      HFORM  form_begin(hDlg)
  2530.  
  2531.                 Begins a form definition.
  2532.  
  2533.                 Parameter       Type/Description
  2534.                 ---------       ----------------
  2535.                 hDlg            HWND    The window handle of the dialog box.
  2536.  
  2537.     Return Value    The new form's handle or NULL if an error occurred. This
  2538.                     handle should be assigned to a static or global variable
  2539.                     for use in future function calls.
  2540.  
  2541.     Comments    This function must be called during the WM_INITDIALOG
  2542.                 message processing in the dialog procedure.  You should not
  2543.                 call any Windows functions which generate WM_COMMAND
  2544.                 messages before calling form_begin.  Be sure to call
  2545.                 form_end after all controls have been defined.
  2546.  
  2547.     ________________________________________________________________________
  2548.  
  2549.     form_end
  2550.  
  2551.     Syntax      int    form_end(hform)
  2552.  
  2553.                 Ends a form definition.
  2554.  
  2555.                 Parameter       Type/Description
  2556.                 ---------       ----------------
  2557.                 hform           HFORM    The form's handle.
  2558.  
  2559.     Return Value    Nonzero if an error occurred.
  2560.  
  2561.     Comments    This function must be called during the WM_INITDIALOG
  2562.                 message processing in the dialog procedure.  After calling
  2563.                 this function, no more controls can be defined.
  2564.  
  2565.     ________________________________________________________________________
  2566.  
  2567.     form_get_active
  2568.  
  2569.     Syntax      HFORM    form_get_active()
  2570.  
  2571.                 Gets the handle of the active form.
  2572.  
  2573.     Return Value    The handle of the active form or NULL if an error
  2574.  
  2575.  
  2576.                                       46   
  2577.                     occurred.
  2578.  
  2579.     ________________________________________________________________________
  2580.  
  2581.     form_get_from_hdlg
  2582.  
  2583.     Syntax      HFORM    form_get_from_hdlg(hDlg)
  2584.  
  2585.                 Gets the handle of a form associated with a given dialog box
  2586.                 window handle.
  2587.  
  2588.                 Parameter       Type/Description
  2589.                 ---------       ----------------
  2590.                 hDlg            HWND    The window handle of the dialog box.
  2591.  
  2592.     Return Value    The handle of the form associated with the input dialog
  2593.                     box window handle or NULL if an error occurred.
  2594.  
  2595.     ________________________________________________________________________
  2596.  
  2597.     form_has_changed
  2598.  
  2599.     Syntax      int    form_has_changed(hform)
  2600.  
  2601.                 Determines whether any of the defined fields or buttons of a
  2602.                 form have been changed by the user.
  2603.  
  2604.                 Parameter       Type/Description
  2605.                 ---------       ----------------
  2606.                 hform           HFORM    The form's handle.
  2607.  
  2608.     Return Value    TRUE if one or more defined fields or buttons have been
  2609.                     changed by the user, FALSE if no defined fields or
  2610.                     buttons have been changed, or -1 if an error occurred.
  2611.  
  2612.     ________________________________________________________________________
  2613.  
  2614.     form_in_error_cond
  2615.  
  2616.     Syntax      int    form_in_error_cond(hform)
  2617.  
  2618.                 Determines whether a form is in an error condition.
  2619.  
  2620.                 Parameter       Type/Description
  2621.                 ---------       ----------------
  2622.                 hform           HFORM    The form's handle.
  2623.  
  2624.     Return Value    TRUE if the form is in an error condition, FALSE if the
  2625.                     form is not in an error condition, or -1 if an error
  2626.                     occurred.
  2627.  
  2628.     Comments    When a validation error has occurred, the form is in an
  2629.                 error condition.  Even if a field's error handler is active,
  2630.  
  2631.  
  2632.                                       47   
  2633.                 messages are still sent to the dialog procedure.  It is
  2634.                 often desirable to check to see if the form is in an error
  2635.                 condition before processing these messages.  For example, if
  2636.                 the form is in an error condition, you would not want to any
  2637.                 IDOK processing to occur.  Calling this function first can
  2638.                 prevent this from happening.
  2639.  
  2640.     ________________________________________________________________________
  2641.  
  2642.     form_is_cancelled
  2643.  
  2644.     Syntax      int    form_is_cancelled(hform)
  2645.  
  2646.                 Determines whether a form has been cancelled.
  2647.  
  2648.                 Parameter       Type/Description
  2649.                 ---------       ----------------
  2650.                 hform           HFORM    The form's handle.
  2651.  
  2652.     Return Value    TRUE if the form has been cancelled, FALSE if the form
  2653.                     has not been cancelled, or -1 if an error occurred.
  2654.  
  2655.     Comments    The form is cancelled when the user presses the Escape key
  2656.                 or clicks on the "Cancel" button.  Even if the form has been
  2657.                 cancelled, messages are still sent to the dialog procedure.
  2658.                 It is often desirable to check to see if the form has been
  2659.                 cancelled before processing these messages.
  2660.  
  2661.     ________________________________________________________________________
  2662.  
  2663.     form_lock
  2664.  
  2665.     Syntax      LPFORM    form_lock(hform)
  2666.  
  2667.             Locks a form's record in memory so it can be accessed.
  2668.  
  2669.                 Parameter       Type/Description
  2670.                 ---------       ----------------
  2671.                 hform           HFORM    The form's handle.
  2672.  
  2673.     Return Value    A far pointer to the form's record or NULL if an error
  2674.                     occurred.  See the description for the FORM struct for
  2675.                     details.
  2676.  
  2677.     Comments    Once you have obtained a pointer to the form's record, you
  2678.                 are able to read or change any of the record's elements.
  2679.                 However, it is not recommended that you change the values of
  2680.                 any of the elements.
  2681.  
  2682.                 When you are done accessing the form's record, be sure to
  2683.                 call form_unlock.
  2684.  
  2685.                 Calling this function locks the form's record in the .DLL's
  2686.  
  2687.  
  2688.                                       48   
  2689.                 local heap.  In addition, the .DLL's entire data segment is
  2690.                 locked in the global heap.  This is required to ensure the
  2691.                 returned far pointer will remain valid until the call to
  2692.                 form_unlock.  For this reason, you should not keep the form
  2693.                 locked any longer than absolutely necessary.
  2694.  
  2695.     ________________________________________________________________________
  2696.  
  2697.     form_process
  2698.  
  2699.     Syntax      int    form_process(hform)
  2700.  
  2701.                 Processes all defined controls in a form.  Calling this
  2702.                 function copies the values contained in the defined fields
  2703.                 and buttons to the data items specified in the calls to
  2704.                 field_define and button_define.
  2705.  
  2706.                 Parameter       Type/Description
  2707.                 ---------       ----------------
  2708.                 hform           HFORM    The form's handle.
  2709.  
  2710.     Return Value    Nonzero if an error occurred.
  2711.  
  2712.     Comments    This function is normally called during IDOK processing of
  2713.                 the WM_COMMAND message in the dialog procedure.  The
  2714.                 dproc_enter_idok, form_in_error_cond, and form_validate
  2715.                 functions must be called first to ensure none of the fields'
  2716.                 values have been invalidated.  EndDialog cannot be called
  2717.                 until after calling this function.
  2718.  
  2719.     ________________________________________________________________________
  2720.  
  2721.     form_set_help
  2722.  
  2723.     Syntax      int    form_set_help(hform, help_file_name)
  2724.  
  2725.                 Sets the file name of the Windows Help file to be used for
  2726.                 context-sensitive help for individual controls in the dialog
  2727.                 box.
  2728.  
  2729.                 Parameter       Type/Description
  2730.                 ---------       ----------------
  2731.                 hform           HFORM    The form's handle.
  2732.  
  2733.                 help_file_name  LPSTR    Pointer to the character string
  2734.                                 containing the Windows Help file name.  The
  2735.                                 full drive:path specification can be
  2736.                                 included.
  2737.  
  2738.     Return Value    Nonzero if an error occurred.
  2739.  
  2740.     Comments    This function must be called if context-sensitive help is to
  2741.                 be applied to individual controls.
  2742.  
  2743.  
  2744.                                       49   
  2745.  
  2746.     ________________________________________________________________________
  2747.  
  2748.     form_terminate
  2749.  
  2750.     Syntax      int    form_terminate(hform)
  2751.  
  2752.                 Terminates the form.  All memory allocated by the form and
  2753.                 the defined controls within it will be freed.
  2754.  
  2755.                 Parameter       Type/Description
  2756.                 ---------       ----------------
  2757.                 hform           HFORM    The form's handle.
  2758.  
  2759.     Return Value    Nonzero if an error occurred.
  2760.  
  2761.     Comments    This function is normally called during IDOK and IDCANCEL
  2762.                 processing of the WM_COMMAND message in the dialog
  2763.                 procedure.  The call to EndDialog must be made before
  2764.                 calling this function.
  2765.  
  2766.                 All handles and pointers to the form and its defined
  2767.                 cotnrols will no longer be valid after calling this
  2768.                 function.
  2769.  
  2770.     ________________________________________________________________________
  2771.  
  2772.     form_unlock
  2773.  
  2774.     Syntax      void    form_unlock(hform)
  2775.  
  2776.                 Unlocks a form's record in memory.
  2777.  
  2778.                 Parameter       Type/Description
  2779.                 ---------       ----------------
  2780.                 hform           HFORM    The form's handle.
  2781.  
  2782.     Return Value    None.
  2783.  
  2784.     ________________________________________________________________________
  2785.  
  2786.     form_validate
  2787.  
  2788.     Syntax      HFIELD    form_validate(hform)
  2789.  
  2790.                 Validates all fields in a form.  If a field fails
  2791.                 validation, input focus will be set to the field in error.
  2792.  
  2793.                 Parameter       Type/Description
  2794.                 ---------       ----------------
  2795.                 hform           HFORM    The form's handle.
  2796.  
  2797.     Return Value    The handle of the field that failed validation or NULL
  2798.  
  2799.  
  2800.                                       50   
  2801.                     if all fields passed validation.  A value of -1 will be
  2802.                     returned in the event of an error.
  2803.  
  2804.     Comments    This function is normally called during IDOK processing of
  2805.                 the WM_COMMAND message in the dialog procedure.  The
  2806.                 dproc_enter_idok and form_in_error_cond functions must be
  2807.                 called before calling this function.
  2808.  
  2809.                 If a field fails validation, IDOK processing should be
  2810.                 discontinued.
  2811.  
  2812.     ________________________________________________________________________
  2813.  
  2814.     genctrl_define
  2815.  
  2816.     Syntax      HGENCTRL    genctrl_define(hform, ctrl_id, help_context)
  2817.  
  2818.                 Defines a generic control.
  2819.  
  2820.                 Parameter       Type/Description
  2821.                 ---------       ----------------
  2822.                 hform           HFORM    The form's handle.
  2823.  
  2824.                 ctrl_id         int    The dialog control ID of the control
  2825.                                 to define.
  2826.  
  2827.                 help_context    DWORD    The help context identifier of the
  2828.                                 Windows Help topic associated with the
  2829.                                 control.  If context-sensitive help is not
  2830.                                 being applied to the control, set
  2831.                                 help_context to 0.  If context-sensitive
  2832.                                 help is being applied to the control, the
  2833.                                 form_set_help function must be called prior
  2834.                                 to the F1 key being pressed.
  2835.  
  2836.     Return Value    The handle of the new generic control's record or NULL
  2837.                     if an error occurred.  An error can be caused by one of
  2838.                     the following conditions:
  2839.  
  2840.                         Control ID is invalid.
  2841.                         The form_end function has already been called.
  2842.                         Memory allocation error.
  2843.  
  2844.     ________________________________________________________________________
  2845.  
  2846.     statmsg_define
  2847.  
  2848.     Syntax      int    statmsg_define(hform, ctrl_id, which, onmsg, offmsg)
  2849.  
  2850.                 Defines a static text control to be used as a status message
  2851.                 for the Insert, CapsLock, or NumLock key.
  2852.  
  2853.                 Parameter       Type/Description
  2854.  
  2855.  
  2856.                                       51   
  2857.                 ---------       ----------------
  2858.                 hform           HFORM    The form's handle.
  2859.  
  2860.                 ctrl_id         int    The dialog control ID of the static
  2861.                                 text control to be used for the status
  2862.                                 message.
  2863.  
  2864.                 which           int    Identifier that specifies which
  2865.                                 status message is to be assigned to the
  2866.                                 control.  Can be one of the following
  2867.                                 values:
  2868.  
  2869.                                 Value           Meaning
  2870.                                 -----           -------
  2871.                                 SM_INSERT       Insert key status message.
  2872.  
  2873.                                 SM_CAPSLOCK     CapsLock key status message.
  2874.  
  2875.                                 SM_NUMLOCK      NumLock key status message.
  2876.  
  2877.                 onmsg           LPSTR    The message to set the static text
  2878.                                 control to when the key identified by which
  2879.                                 is toggled on.
  2880.  
  2881.                 offmsg          LPSTR    The message to set the static text
  2882.                                 control to when the key identified by which
  2883.                                 is toggled off.
  2884.  
  2885.     Return Value    Nonzero if an error occurred.
  2886.  
  2887.     Comments    The static text control used for the key status message will
  2888.                 be updated automatically when the user toggles the key.
  2889.                 However, if the key is toggled while the user is in a
  2890.                 control that has not been defined, the message will not be
  2891.                 updated until the user moves to a control that has been
  2892.                 defined.
  2893.  
  2894.     ________________________________________________________________________
  2895.  
  2896.     str_delete_char
  2897.  
  2898.     Syntax      int    str_delete_char(pstr, ch)
  2899.  
  2900.                 Deletes the first occurrence of a character from a string.
  2901.  
  2902.                 Parameter       Type/Description
  2903.                 ---------       ----------------
  2904.                 pstr            LPSTR    Pointer to the string to operate
  2905.                                 on.
  2906.  
  2907.                 ch              int    The character to delete.
  2908.  
  2909.     Return Value    Nonzero if the character was not found.
  2910.  
  2911.  
  2912.                                       52   
  2913.  
  2914.     ________________________________________________________________________
  2915.  
  2916.     str_insert_char
  2917.  
  2918.     Syntax      void    str_insert_char(pstr, ch, offs)
  2919.  
  2920.                 Inserts a character into a string.
  2921.  
  2922.                 Parameter       Type/Description
  2923.                 ---------       ----------------
  2924.                 pstr            LPSTR    Pointer to the string to operate
  2925.                                 on.
  2926.  
  2927.                 ch              int    The character to insert.
  2928.  
  2929.                 offs            int    The offset into the string where the
  2930.                                 character is to be inserted.
  2931.  
  2932.     Return Value    None.
  2933.  
  2934.     ________________________________________________________________________
  2935.  
  2936.     str_is_blank
  2937.  
  2938.     Syntax      BOOL    str_is_blank(pstr)
  2939.  
  2940.                 Determines whether a string is blank.
  2941.  
  2942.                 Parameter       Type/Description
  2943.                 ---------       ----------------
  2944.                 pstr            LPSTR    Pointer to the string to test.
  2945.  
  2946.     Return Value    TRUE if the string is blank; otherwise FALSE.
  2947.  
  2948.     ________________________________________________________________________
  2949.  
  2950.     str_is_value_zero
  2951.  
  2952.     Syntax      BOOL    str_is_value_zero(pstr)
  2953.  
  2954.                 Determines whether a string contains a numeric value of
  2955.                 zero.
  2956.  
  2957.                 Parameter       Type/Description
  2958.                 ---------       ----------------
  2959.                 pstr            LPSTR    Pointer to the string to test.
  2960.  
  2961.     Return Value    TRUE if the string contains a numeric value of zero;
  2962.                     otherwise FALSE.
  2963.  
  2964.     ________________________________________________________________________
  2965.  
  2966.  
  2967.  
  2968.                                       53   
  2969.     str_trim_spaces
  2970.  
  2971.     Syntax      void    str_trim_spaces(pstr)
  2972.  
  2973.                 Trims trailing spaces from a string.
  2974.  
  2975.                 Parameter       Type/Description
  2976.                 ---------       ----------------
  2977.                 pstr            LPSTR    Pointer to the string to operate
  2978.                                 on.
  2979.  
  2980.     Return Value    None.
  2981.  
  2982.  
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.  
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.                                       54   
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.                               Data Type Reference
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.                                       55   
  3081.  
  3082.     BUTTON
  3083.  
  3084.     Button Record
  3085.  
  3086.             The BUTTON structure contains information about a defined
  3087.             button.
  3088.  
  3089.             typedef struct {
  3090.                 HWND hWnd;
  3091.                 HBUTTON hbutton;
  3092.                 HBUTTON hnext_button;
  3093.                 int ctrl_id;
  3094.                 LPINT pdata;
  3095.                 int group_id;
  3096.                 int on_value;
  3097.                 int off_value;
  3098.                 DWORD help_context;
  3099.                 BOOL has_changed;
  3100.             } BUTTON;
  3101.  
  3102.             The BUTTON structure contains the following elements:
  3103.  
  3104.             Element         Description
  3105.             -------         -----------
  3106.             hWnd            Window handle of the button control.
  3107.  
  3108.             hbutton         Handle of the BUTTON data structure.
  3109.                             (Self-reference)
  3110.  
  3111.             hnext_button    Handle of the next BUTTON data structure in the
  3112.                             linked list of buttons.
  3113.  
  3114.             ctrl_id         Dialog control ID of the button control
  3115.                             associated with the button.
  3116.  
  3117.             pdata           Pointer to the integer variable being updated or
  3118.                             initialized by the button.
  3119.  
  3120.             group_id        Group ID of the button.  Other buttons with the
  3121.                             same group ID belong to the same group as this
  3122.                             button.
  3123.  
  3124.             on_value        The value that will be stored at the integer
  3125.                             variable pointed to by pdata if the button is
  3126.                             checked.
  3127.  
  3128.             off_value       The value that will be stored at the integer
  3129.                             variable pointed to by pdata if the button is
  3130.                             not checked.
  3131.  
  3132.             help_context    The help context identifier of the Windows Help
  3133.                             topic associated with the button. has_changed
  3134.  
  3135.  
  3136.                                       56   
  3137.                             Flag indicating whether the button has been
  3138.                             changed by the user.
  3139.  
  3140.     Comments    The values of these elements should not be directly changed.
  3141.  
  3142.     ________________________________________________________________________
  3143.  
  3144.     FIELD
  3145.  
  3146.     Field Record
  3147.  
  3148.             The FIELD structure contains information about a defined field.
  3149.  
  3150.             typedef struct {
  3151.                 HWND hwnd;
  3152.                 HWND hcombo;
  3153.                 HFIELD hfield;
  3154.                 HFIELD hnext_field;
  3155.                 int ctrl_id;
  3156.                 LPVOID pdata;
  3157.                 int data_type;
  3158.                 LPSTR picture_string;
  3159.                 DWORD features;
  3160.                 int (FAR PASCAL *pvalid_func) (LPSTR);
  3161.                 int error_value;
  3162.                 DWORD help_context;
  3163.                 BOOL has_changed;
  3164.                 int logical_size;
  3165.                 int physical_size;
  3166.                 int decimal_position;
  3167.             } FIELD;
  3168.  
  3169.             The FIELD structure contains the following elements:
  3170.  
  3171.             Element         Description
  3172.             -------         -----------
  3173.             hwnd            Window handle of the field's edit control.
  3174.  
  3175.             hcombo          Window handle of the combo box a field belongs
  3176.                             to.
  3177.  
  3178.             hfield          Handle of the FIELD data structure.
  3179.                             (Self-reference)
  3180.  
  3181.             hnext_field     Handle of the next FIELD data structure in the
  3182.                             linked list of fields.
  3183.  
  3184.             ctrl_id         Dialog control ID of the edit control associated
  3185.                             with the field.
  3186.  
  3187.             pdata           Pointer to the data item being updated or
  3188.                             initialized by the field.  This can point to a
  3189.                             character string, integer, unsigned integer,
  3190.  
  3191.  
  3192.                                       57   
  3193.                             long integer, unsigned long integer, or double
  3194.                             precision floating point data type.
  3195.  
  3196.             data_type       Specifies what pdata points to.  See the
  3197.                             description of the field_define function for a
  3198.                             list of possible values.
  3199.  
  3200.             picture_string  Pointer to the picture string associated with
  3201.                             the field.
  3202.  
  3203.             features        Contains one or more field features combined
  3204.                             with the bitwise OR operator.  See the
  3205.                             description of the field_define function for a
  3206.                             list of possible values.
  3207.  
  3208.             pvalid_func     Procedure-instance address of the field's
  3209.                             validation function.
  3210.  
  3211.             error_value     Value that gets passed to the dialog procedure
  3212.                             (in the wParam parameter of the WM_COMMAND
  3213.                             message) when the validation function returns an
  3214.                             error.
  3215.  
  3216.             help_context    The help context identifier of the Windows Help
  3217.                             topic associated with the field.
  3218.  
  3219.             has_changed     Flag indicating whether the field has been
  3220.                             edited by the user.
  3221.  
  3222.             logical_size    Logical size of the field.
  3223.  
  3224.             physical_size   Physical size of the field.
  3225.  
  3226.             decimal_position    Virtual logical position of the decimal
  3227.                                 point.
  3228.  
  3229.     Comments    The values of these elements should not be directly changed.
  3230.  
  3231.     ________________________________________________________________________
  3232.  
  3233.     FIELD_POS
  3234.  
  3235.     Field Position Information
  3236.  
  3237.             The FIELD_POS structure contains information about a position in
  3238.             a field.
  3239.  
  3240.             typedef struct {
  3241.                 long selection;
  3242.                 int physical_position;
  3243.                 int logical_position;
  3244.                 BOOL to_right_of_dec;
  3245.                 LPSTR ppicture_str_pos;
  3246.  
  3247.  
  3248.                                       58   
  3249.                 int val_char_occ;
  3250.                 char validation_char;
  3251.             } FIELD_POS;
  3252.  
  3253.             The FIELD_POS structure contains the following elements:
  3254.  
  3255.             Element             Description
  3256.             -------             -----------
  3257.             selection           The field's selection.  The low-order word
  3258.                                 will always be equal to the high-order word.
  3259.  
  3260.             physical_position   The field's physical position.  The
  3261.                                 low-order and high-order words of selection
  3262.                                 are equal to this value.
  3263.  
  3264.             logical_position    The field's logical position.
  3265.  
  3266.             to_right_of_dec     Flag indicating whether the position is on
  3267.                                 the right-hand side of the decimal.
  3268.  
  3269.             ppicture_str_pos    Pointer to the position in the picture
  3270.                                 string that is associated with the position.
  3271.  
  3272.             val_char_occ        Validation character occurrence.  When there
  3273.                                 is multiple occurrence validation characters
  3274.                                 (such as "A(25)") in a field, the values for
  3275.                                 ppicture_str_pos and validation_char will
  3276.                                 remain the same regardless of which
  3277.                                 occurrence the position is at.  The
  3278.                                 val_char_occ identifies which occurrence the
  3279.                                 position is associated with.
  3280.  
  3281.             validation_char     The validation character.  See Appendix A
  3282.                                 for a list of possible values.
  3283.  
  3284.     ________________________________________________________________________
  3285.  
  3286.     FORM
  3287.  
  3288.     Form Record
  3289.  
  3290.             The FORM structure contains information about a form.
  3291.  
  3292.             typedef struct {
  3293.                 HWND hdlg;
  3294.                 HFORM hform;
  3295.                 HFORM hnext_form;
  3296.                 HFIELD hhead_field;
  3297.                 HFIELD hcurr_field;
  3298.                 HBUTTON hhead_button;
  3299.                 HANDLE hproc_array;
  3300.                 int num_controls;
  3301.                 LPSTR help_file_name;
  3302.  
  3303.  
  3304.                                       59   
  3305.                 int insert_id;
  3306.                 LPSTR insert_onmsg;
  3307.                 LPSTR insert_offmsg;
  3308.                 int capslock_id;
  3309.                 LPSTR capslock_onmsg;
  3310.                 LPSTR capslock_offmsg;
  3311.                 int numlock_id;
  3312.                 LPSTR numlock_onmsg;
  3313.                 LPSTR numlock_offmsg;
  3314.                 BOOL pressed_cancel;
  3315.                 BOOL error_condition;
  3316.                 BOOL ignore_ok;
  3317.                 BOOL edit_key_pressed;
  3318.                 BOOL just_passed_dec;
  3319.                 BOOL help_invoked;
  3320.             } FORM;
  3321.  
  3322.             The FORM structure contains the following elements:
  3323.  
  3324.             Element             Description
  3325.             -------             -----------
  3326.             hdlg                The window handle of the dialog box
  3327.                                 associated with the form.
  3328.  
  3329.             hform               Handle of the FORM data structure.
  3330.                                 (Self-reference)
  3331.  
  3332.             hnext_form          Handle of the next FORM data structure in
  3333.                                 the linked list of forms.
  3334.  
  3335.             hhead_field         Handle of the head FIELD structure in the
  3336.                                 linked list of fields.
  3337.  
  3338.             hcurr_field         Handle of the FIELD structure of the current
  3339.                                 field.
  3340.  
  3341.             hhead_button        Handle of the head BUTTON structure in the
  3342.                                 linked list of buttons.
  3343.  
  3344.             hproc_array         Handle of the memory block which contains
  3345.                                 the window procedure array that holds the
  3346.                                 window procedure addresses for each defined
  3347.                                 control.
  3348.  
  3349.             num_controls        Number of defined controls in the form.
  3350.  
  3351.             help_file_name      Pointer to the character string containing
  3352.                                 the help file name.
  3353.  
  3354.             insert_id           Dialog control ID of the static text control
  3355.                                 used for the Insert key status message.
  3356.  
  3357.             insert_onmsg        Pointer to the character string containing
  3358.  
  3359.  
  3360.                                       60   
  3361.                                 the message indicating the Insert key is on.
  3362.  
  3363.             insert_offmsg       Pointer to the character string containing
  3364.                                 the message indicating the Insert key is
  3365.                                 off.
  3366.  
  3367.             capslock_id         Dialog control ID of the static text control
  3368.                                 used for the CapsLock key status message.
  3369.  
  3370.             capslock_onmsg      Pointer to the character string containing
  3371.                                 the message indicating the CapsLock key is
  3372.                                 on.
  3373.  
  3374.             capslock_offmsg     Pointer to the character string containing
  3375.                                 the message indicating the CapsLock key is
  3376.                                 off.
  3377.  
  3378.             numlock_id          Dialog control ID of the static text control
  3379.                                 used for the NumLock key status message.
  3380.  
  3381.             numlock_onmsg       Pointer to the character string containing
  3382.                                 the message indicating the NumLock key is
  3383.                                 on.
  3384.  
  3385.             numlock_offmsg      Pointer to the character string containing
  3386.                                 the message indicating the NumLock key is
  3387.                                 off.
  3388.  
  3389.             pressed_cancel      Flag indicating whether the user pressed or
  3390.                                 clicked on the "Cancel" button.
  3391.  
  3392.             error_condition     Flag indicating whether the form is in an
  3393.                                 error condition. The form is in an error
  3394.                                 condition when a field fails validation.
  3395.  
  3396.             ignore_ok           Flag indicating whether the "OK" button or
  3397.                                 Enter key should be ignored.  Used with
  3398.                                 field validation.
  3399.  
  3400.             edit_key_pressed    Flag indicating whether the last key pressed
  3401.                                 was an editing key or a character key.
  3402.  
  3403.             just_passed_dec     Flag indicating whether the last keystroke
  3404.                                 moved the cursor from the position to the
  3405.                                 left of the decimal to the position to the
  3406.                                 right of the decimal.
  3407.  
  3408.             help_invoked        Flag indicating whether the Windows Help
  3409.                                 application has been invoked from within any
  3410.                                 of the defined controls.
  3411.  
  3412.     Comments    The values of these elements should not be directly changed.
  3413.  
  3414.  
  3415.  
  3416.                                       61   
  3417.     ________________________________________________________________________
  3418.  
  3419.     HBUTTON
  3420.  
  3421.     Handle of a BUTTON Structure
  3422.  
  3423.             typedef HANDLE HBUTTON;
  3424.  
  3425.     ________________________________________________________________________
  3426.  
  3427.     HFIELD
  3428.  
  3429.     Handle of a FIELD Structure
  3430.  
  3431.             typedef HANDLE HFIELD;
  3432.  
  3433.     ________________________________________________________________________
  3434.  
  3435.     HFORM
  3436.  
  3437.     Handle of a FORM Structure
  3438.  
  3439.             typedef HANDLE HFORM;
  3440.  
  3441.     ________________________________________________________________________
  3442.  
  3443.     HGENCTRL
  3444.  
  3445.     Handle of a Generic Control Record
  3446.  
  3447.             typedef HBUTTON HGENCTRL;
  3448.  
  3449.     Comments    The BUTTON data structure is used for storage of information
  3450.                 about a generic control.
  3451.  
  3452.     ________________________________________________________________________
  3453.  
  3454.     LPBUTTON
  3455.  
  3456.     Far Pointer to a BUTTON Structure
  3457.  
  3458.             typedef BUTTON FAR * LPBUTTON;
  3459.  
  3460.     ________________________________________________________________________
  3461.  
  3462.     LPFIELD
  3463.  
  3464.     Far Pointer to a FIELD Structure
  3465.  
  3466.             typedef FIELD FAR * LPFIELD;
  3467.  
  3468.     ________________________________________________________________________
  3469.  
  3470.  
  3471.  
  3472.                                       62   
  3473.     LPFIELD_POS
  3474.  
  3475.     Far Pointer to a FIELD_POS Structure
  3476.  
  3477.             typedef FIELD_POS FAR * LPFIELD_POS;
  3478.  
  3479.     ________________________________________________________________________
  3480.  
  3481.     LPFORM
  3482.  
  3483.     Far Pointer to a FORM Structure
  3484.  
  3485.             typedef FORM FAR * LPFORM;
  3486.  
  3487.     ________________________________________________________________________
  3488.  
  3489.     PBUTTON
  3490.  
  3491.     Pointer to a BUTTON Structure
  3492.  
  3493.             typedef BUTTON * PBUTTON;
  3494.  
  3495.     ________________________________________________________________________
  3496.  
  3497.     PFIELD
  3498.  
  3499.     Pointer to a FIELD Structure
  3500.  
  3501.             typedef FIELD * PFIELD;
  3502.  
  3503.     ________________________________________________________________________
  3504.  
  3505.     PFIELD_POS
  3506.  
  3507.     Pointer to a FIELD_POS Structure
  3508.  
  3509.             typedef FIELD_POS * PFIELD_POS;
  3510.  
  3511.     ________________________________________________________________________
  3512.  
  3513.     PFORM
  3514.  
  3515.     Pointer to a FORM Structure
  3516.  
  3517.             typedef FORM * PFORM;
  3518.  
  3519.     ________________________________________________________________________
  3520.  
  3521.     PROC_ARRAY_INFO
  3522.  
  3523.     Dialog Control Window Procedure Array Information
  3524.  
  3525.             The PROC_ARRAY_INFO structure is used to hold information about
  3526.  
  3527.  
  3528.                                       63   
  3529.             a dialog control's window procedure.
  3530.  
  3531.             typedef struct {
  3532.                 HWND hWnd;
  3533.                 FARPROC lpProc;
  3534.             } PROC_ARRAY_INFO;
  3535.  
  3536.             The PROC_ARRAY_INFO structure contains the following elements:
  3537.  
  3538.             Element     Description
  3539.             -------     -----------
  3540.             hWnd        The window handle of the dialog control.
  3541.  
  3542.             lpProc      Pointer to the dialog control's window procedure.
  3543.  
  3544.     Comments    The window procedure array is not accessible.  This data
  3545.                 structure is listed solely because it appears in the library
  3546.                 header file.
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.                                       64   
  3585.  
  3586.     Appendix A:  Picture String Characters
  3587.  
  3588.  
  3589.     Character       Meaning
  3590.     ---------       -------
  3591.     9               Accept an integer numeric character (0 - 9).
  3592.  
  3593.     #               Accept a real numeric character (0 - 9, -, +, ., E, e).
  3594.  
  3595.     A               Accept an alphabetic character (A - Z, a - z).  Foreign
  3596.                     alphabetic characters are supported.
  3597.  
  3598.     X               Accept an alphanumeric character (A - Z, a - z, 0 - 9).
  3599.                     Foreign alphabetic characters are supported.
  3600.  
  3601.     Y               Accept a yes/no character (Y, y, N, n).
  3602.  
  3603.     D               Accept a date character (0 - 9, -, /).
  3604.  
  3605.     T               Accept a telephone number character (0 - 9, (, ), -, +).
  3606.  
  3607.     F               Accept a file name character (any character except \, :,
  3608.                     *, ?, ;, ,, =, +, <, >, |, /, [, ], ").
  3609.  
  3610.     P               Accept a pathspec character (any character except ;, ,,
  3611.                     =, +, <, >, |, /, [, ], ").
  3612.  
  3613.     ?               Accept any printable character.
  3614.  
  3615.     !               Accept any printable character.  If the character is a
  3616.                     lowercase letter, convert it to uppercase.  Foreign
  3617.                     alphabetic characters are supported.
  3618.  
  3619.     < ..... >       Accept only one of the characters listed between the
  3620.                     angle brackets. For example, "<0123>" will accept only
  3621.                     0, 1, 2, or 3.  Also you can specify a range using two
  3622.                     periods between the two range limiting characters.  For
  3623.                     example, "<0..3>" would be equivalent to "<0123>".  Or
  3624.                     you can get fancy, "<0..3>5<7..9>" would accept 0, 1, 2,
  3625.                     3, 5, 7, 8, or 9. Characters are converted to uppercase.
  3626.                     For example, "<A..Z>" will accept any uppercase or
  3627.                     lowercase letter.
  3628.  
  3629.     > ..... <       Accept any character except the ones listed between the
  3630.                     angle brackets.  Works similar to the "<.....>"
  3631.                     characters.
  3632.  
  3633.     ( ..... )       Specifies multiple occurrences of one of the above
  3634.                     validation characters.  For example, "A(5)" is
  3635.                     equivalent to "AAAAA". "<0123>(3)" is equivalent to
  3636.                     "<0123><0123><0123>".  The open parenthesis must
  3637.                     immediately follow the validation character.
  3638.  
  3639.  
  3640.                                       65   
  3641.  
  3642.     ' ..... '       Insert formatting characters into field.  All characters
  3643.                     between the single quotes are formatting characters.
  3644.  
  3645.     \" ..... \"     Double quotes have the meaning as single quotes.  Useful
  3646.                     for when you need to insert formatting characters that
  3647.                     include the single quote character.  Note in the C
  3648.                     programming language, the backslashes preceding the
  3649.                     double quote characters are required.
  3650.  
  3651.     .               Special formatting character which specifies where the
  3652.                     decimal point will be in a numeric field.  You can only
  3653.                     have one decimal point in a picture string.  The field
  3654.                     must have either the FDF_NUMERIC or FDF_CALCNUM feature
  3655.                     defined.
  3656.  
  3657.     ,               Special formatting character which specifies where
  3658.                     conditional commas will be located in a calculator-style
  3659.                     numeric field.  A comma will only be displayed if a
  3660.                     digit exists to the left of it.  The field must have the
  3661.                     FDF_CALCNUM feature defined.
  3662.  
  3663.     space           The space character can be used throughout the picture
  3664.                     string to improve readability.  Do not put spaces
  3665.                     between angle brackets or quotes unless you intend for
  3666.                     them to be there.
  3667.  
  3668.  
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.                                       66   
  3697.  
  3698.     Appendix B:  Field Editing Keys
  3699.  
  3700.  
  3701.                               CURSOR MOVEMENT
  3702.  
  3703.     Editing Key         Action
  3704.     -----------         ------
  3705.     LeftArrow           Moves the cursor to the previous position.
  3706.  
  3707.     RightArrow          Moves the cursor to the next position.
  3708.  
  3709.     Ctrl-LeftArrow      Moves the cursor to the beginning of the previous
  3710.                         word.
  3711.  
  3712.     Ctrl-RightArrow     Moves the cursor to the beginning of the next word.
  3713.  
  3714.     Home                Moves the cursor to the first position in the field.
  3715.  
  3716.     End                 Moves the cursor to the position following the last
  3717.                         character in the field.
  3718.  
  3719.     Ctrl-End            Move the cursor to the last position in the field.
  3720.  
  3721.  
  3722.                               TEXT DELETION
  3723.  
  3724.     Editing Key         Action
  3725.     -----------         ------
  3726.     Backspace           Deletes the character to the left of the cursor.
  3727.  
  3728.     Delete              Deletes the character at the cursor.
  3729.  
  3730.     Ctrl-Backspace      Deletes the word to the left of the cursor.
  3731.  
  3732.     Ctrl-Delete         Deletes the word at the cursor.
  3733.  
  3734.     Ctrl-Shift-Delete   Deletes all characters to the right of the cursor.
  3735.  
  3736.  
  3737.  
  3738.                                   CLIPBOARD
  3739.  
  3740.     Editing Key         Action
  3741.     -----------         ------
  3742.     Ctrl-Insert         Copies the contents of field to the clipboard.
  3743.  
  3744.     Shift-Insert        Pastes the contents of the clipboard into the field.
  3745.  
  3746.     Shift-Delete        Cuts the contents of the field to the clipboard.
  3747.  
  3748.  
  3749.                                   TOGGLES
  3750.  
  3751.  
  3752.                                       67   
  3753.  
  3754.     Editing Key         Action
  3755.     -----------         ------
  3756.     Insert              Toggles Insert mode.
  3757.  
  3758.     CapsLock            Toggles Caps Lock mode.
  3759.  
  3760.     NumLock             Toggles Num Lock mode.
  3761.  
  3762.  
  3763.                                 MISCELLANEOUS
  3764.  
  3765.     Editing Key         Action
  3766.     -----------         ------
  3767.     Enter               Terminates processing of the form.  Field changes
  3768.                         are saved.
  3769.  
  3770.     Esc                 Terminates processing of the form.  None of the
  3771.                         field changes will be saved.
  3772.  
  3773.     Tab                 Sets the input focus to the next dialog control with
  3774.                         the WS_TABSTOP style.
  3775.  
  3776.     Shift-Tab           Sets the input focus to the previous dialog control
  3777.                         with the WS_TABSTOP style.
  3778.  
  3779.     Alt-Backspace       Restores the field to its previous contents.
  3780.  
  3781.     F1                  Displays context-sensitive help for the field.
  3782.  
  3783.  
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.                                       68   
  3809.  
  3810.  
  3811.     Appendix C:  Glossary
  3812.  
  3813.  
  3814.     button
  3815.         A button is a dialog box button control with an on and off state
  3816.         defined by the button_define function.  The button control is
  3817.         usually a radio button or check box.
  3818.  
  3819.     button control
  3820.         A button control is a Windows dialog control that can be set either
  3821.         on or off.  A button control is actually a window of class "button"
  3822.         and is a child of the dialog box window.
  3823.  
  3824.     cursor
  3825.         The cursor is the blinking vertical bar that identifies the user's
  3826.         position in a field. Throughout the Windows SDK documentation, the
  3827.         term "cursor" refers to the mouse pointer and the term "caret"
  3828.         refers to the cursor.
  3829.  
  3830.     edit control
  3831.         An edit control is a Windows dialog control that is used for the
  3832.         input of text information by the user.  An edit control is actually
  3833.         a window of class "edit" and is a child of the dialog box window.
  3834.  
  3835.     edit field
  3836.         Another name for an edit control.
  3837.  
  3838.     field
  3839.         A field is a dialog box edit control that has been defined by the
  3840.         field_define function.
  3841.  
  3842.     form
  3843.         A form is a dialog box with one or more WEDL-defined controls within
  3844.         it.
  3845.  
  3846.     formatting characters
  3847.         Formatting characters are the characters embedded in a field to
  3848.         assist the user in entering the correct data.  The positions of the
  3849.         formatting characters in a field are defined in the picture string.
  3850.         The user is not able to move the cursor to, or edit, the formatting
  3851.         characters. The '/' characters in a date field, and the '(', ')',
  3852.         and '-' characters in a phone number field are good examples of
  3853.         formatting characters.
  3854.  
  3855.     generic control
  3856.         A generic control can be any control in a dialog box defined by the
  3857.         genctrl_define function.
  3858.  
  3859.     logical field contents
  3860.         The logical field contents are the contents of a field without the
  3861.         embedded formatting characters.  To get the logical contents of a
  3862.  
  3863.  
  3864.                                       69   
  3865.         field, call the field_get_text function.
  3866.  
  3867.     logical field format
  3868.         A character string is in logical field format if it contains no
  3869.         embedded formatting characters and it can be used to set the
  3870.         contents of a field.  You can set the contents of a field using a
  3871.         character string in logical field format by calling the
  3872.         field_set_text function.
  3873.  
  3874.     mouse pointer
  3875.         The mouse pointer is the icon on the screen that identifies where
  3876.         the mouse currently is.  This icon is very often a white arrow, but
  3877.         can have just about any shape. Throughout the Windows SDK, the term
  3878.         "cursor" refers to the mouse pointer.
  3879.  
  3880.     physical field contents
  3881.         The physical field contents are the contents of a field including
  3882.         the embedded formatting characters.  If you were to call
  3883.         GetDlgItemText on the field, you would get its physical contents,
  3884.         but it is preferable to use the field_get_text function.
  3885.  
  3886.     physical field format
  3887.         A character string is in physical field format if it contains any
  3888.         embedded formatting characters and it can be used to set the
  3889.         contents of a field.  You can set the contents of a field using a
  3890.         character string in physical field format by calling the
  3891.         field_set_text function.
  3892.  
  3893.     picture string
  3894.         The picture string is a character string assigned to a field by the
  3895.         field_define function.  It is used to define the number of
  3896.         characters in a field, the allowable characters for each position in
  3897.         the field (validation characters), and the placement of formatting
  3898.         characters.  See Appendix A for a list of characters that can exist
  3899.         in a picture string.
  3900.  
  3901.     validation character
  3902.         A validation character is a character in a picture string which is
  3903.         used to define the allowable characters that can be input for the
  3904.         corresponding position in its field.  See Appendix A for a list of
  3905.         validation characters.
  3906.  
  3907.     validation function
  3908.         A validation function is a function written by the programmer to
  3909.         validate the information in a field.  A validation function is
  3910.         assigned to a field by the field_define function.
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.                                       70   
  3921.